mirror of
https://github.com/infiniflow/ragflow.git
synced 2025-12-08 20:42:30 +08:00
### What problem does this PR solve? feat: Delete the files uploaded in the external dialog box #1880 ### Type of change - [x] New Feature (non-breaking change which adds functionality)
This commit is contained in:
@ -313,3 +313,23 @@ export const useRemoveNextDocument = () => {
|
||||
|
||||
return { data, loading, removeDocument: mutateAsync };
|
||||
};
|
||||
|
||||
export const useDeleteDocument = () => {
|
||||
// const queryClient = useQueryClient();
|
||||
const {
|
||||
data,
|
||||
isPending: loading,
|
||||
mutateAsync,
|
||||
} = useMutation({
|
||||
mutationKey: ['deleteDocument'],
|
||||
mutationFn: async (documentIds: string[]) => {
|
||||
const data = await kbService.document_delete({ doc_ids: documentIds });
|
||||
// if (data.retcode === 0) {
|
||||
// queryClient.invalidateQueries({ queryKey: ['fetchFlowList'] });
|
||||
// }
|
||||
return data;
|
||||
},
|
||||
});
|
||||
|
||||
return { data, loading, deleteDocument: mutateAsync };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user