feat(documents) : add type column, filter, and edit to documents page

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matthieu
2026-03-23 15:41:20 +01:00
parent 736a8bccf9
commit 4db832bc8c
2 changed files with 76 additions and 3 deletions

View File

@@ -49,6 +49,7 @@ interface LoadDocumentsOptions {
orderBy?: string
orderDir?: 'asc' | 'desc'
attachmentFilter?: string
type?: string
force?: boolean
}
@@ -105,10 +106,11 @@ export function useDocuments() {
orderBy = 'createdAt',
orderDir = 'desc',
attachmentFilter = 'all',
type = 'all',
force = false,
} = options
if (!force && loaded.value && !search && page === 1 && attachmentFilter === 'all') {
if (!force && loaded.value && !search && page === 1 && attachmentFilter === 'all' && type === 'all') {
return { success: true, data: documents.value }
}
@@ -130,6 +132,10 @@ export function useDocuments() {
params.set(`exists[${attachmentFilter}]`, 'true')
}
if (type && type !== 'all') {
params.set('type', type)
}
params.set(`order[${orderBy}]`, orderDir)
const result = await get(`/documents?${params.toString()}`)