feat: enhance document list navigation and sorting functionality (#23383)

This commit is contained in:
yyh
2025-08-05 10:19:47 +08:00
committed by GitHub
parent a724f35672
commit d8584dc03a
8 changed files with 966 additions and 28 deletions

View File

@@ -8,7 +8,7 @@ import type { MetadataType, SortType } from '../datasets'
import { pauseDocIndexing, resumeDocIndexing } from '../datasets'
import type { DocumentDetailResponse, DocumentListResponse, UpdateDocumentBatchParams } from '@/models/datasets'
import { DocumentActionType } from '@/models/datasets'
import type { CommonResponse } from '@/models/common'
import type { CommonResponse, FileDownloadResponse } from '@/models/common'
// Download document with authentication (sends Authorization header)
import Toast from '@/app/components/base/toast'
@@ -102,7 +102,7 @@ export const useDocumentDownload = () => {
return useMutation({
mutationFn: async ({ datasetId, documentId }: { datasetId: string; documentId: string }) => {
// The get helper automatically adds the Authorization header from localStorage
return get<CommonResponse>(`/datasets/${datasetId}/documents/${documentId}/upload-file`)
return get<FileDownloadResponse>(`/datasets/${datasetId}/documents/${documentId}/upload-file`)
},
onError: (error: any) => {
// Show a toast notification if download fails