mirror of
https://github.com/langgenius/dify.git
synced 2026-11-12 22:31:24 +08:00
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
14 lines
501 B
TypeScript
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 })
|
|
},
|
|
})
|
|
}
|