Files
dify/web/service/knowledge/use-document.ts
T
7cafd65d54 refactor(web): migrate handwritten console API calls to the generated oRPC contract (#44169)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2026-10-16 03:47:31 +00:00

14 lines
501 B
TypeScript

import type { DocumentDownloadZipRequest } from '../datasets'
import { useMutation } from '@tanstack/react-query'
import { downloadDocumentsZip } from '../datasets'
export const useDocumentDownloadZip = () => {
return useMutation({
mutationFn: ({ datasetId, documentIds }: DocumentDownloadZipRequest) => {
if (!datasetId || !documentIds?.length)
throw new Error('datasetId and documentIds are required')
return downloadDocumentsZip({ datasetId, documentIds })
},
})
}