Files
ragflow/web/src/pages/files/use-delete-file.ts
balibabu 1366712560 Feat: Deleting files in batches. #3221 (#7234)
### What problem does this PR solve?
Feat: Deleting files in batches. #3221

### Type of change


- [x] New Feature (non-breaking change which adds functionality)
2025-04-23 19:03:02 +08:00

20 lines
515 B
TypeScript

import { useDeleteFile } from '@/hooks/use-file-request';
import { useCallback } from 'react';
import { useGetFolderId } from './hooks';
export const useHandleDeleteFile = () => {
const { deleteFile: removeDocument } = useDeleteFile();
const parentId = useGetFolderId();
const handleRemoveFile = useCallback(
async (fileIds: string[]) => {
const code = await removeDocument({ fileIds, parentId });
return code;
},
[parentId, removeDocument],
);
return { handleRemoveFile };
};