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)
This commit is contained in:
balibabu
2025-04-23 19:03:02 +08:00
committed by GitHub
parent 51d9bde5a3
commit 1366712560
14 changed files with 405 additions and 98 deletions

View File

@ -0,0 +1,19 @@
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 };
};