mirror of
https://codeberg.org/yeentown/barkey.git
synced 2025-07-07 12:36:57 +00:00
merge: Show all files for Drive Cleaner (!982)
View MR for information: https://activitypub.software/TransFem-org/Sharkey/-/merge_requests/982 Closes #1033 Approved-by: dakkar <dakkar@thenautilus.net> Approved-by: Hazelnoot <acomputerdog@gmail.com>
This commit is contained in:
commit
b66a486036
2 changed files with 8 additions and 5 deletions
|
@ -46,6 +46,7 @@ export const paramDef = {
|
|||
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z\/\-*]+$/.toString().slice(1, -1) },
|
||||
sort: { type: 'string', nullable: true, enum: ['+createdAt', '-createdAt', '+name', '-name', '+size', '-size', null] },
|
||||
searchQuery: { type: 'string', default: '' },
|
||||
showAll: { type: 'boolean', default: false },
|
||||
},
|
||||
required: [],
|
||||
} as const;
|
||||
|
@ -63,10 +64,12 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
const query = this.queryService.makePaginationQuery(this.driveFilesRepository.createQueryBuilder('file'), ps.sinceId, ps.untilId)
|
||||
.andWhere('file.userId = :userId', { userId: me.id });
|
||||
|
||||
if (ps.folderId) {
|
||||
query.andWhere('file.folderId = :folderId', { folderId: ps.folderId });
|
||||
} else {
|
||||
query.andWhere('file.folderId IS NULL');
|
||||
if (!ps.showAll) {
|
||||
if (ps.folderId) {
|
||||
query.andWhere('file.folderId = :folderId', { folderId: ps.folderId });
|
||||
} else {
|
||||
query.andWhere('file.folderId IS NULL');
|
||||
}
|
||||
}
|
||||
|
||||
if (ps.searchQuery.length > 0) {
|
||||
|
|
|
@ -69,7 +69,7 @@ const sortMode = ref('+size');
|
|||
const pagination = {
|
||||
endpoint: 'drive/files' as const,
|
||||
limit: 10,
|
||||
params: computed(() => ({ sort: sortMode.value })),
|
||||
params: computed(() => ({ sort: sortMode.value, showAll: true })),
|
||||
offsetMode: true,
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue