mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 15:31:05 +08:00
Fix: optimize file batch delete (#14473)
### What problem does this PR solve? optimize file batch delete ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@@ -69,7 +69,9 @@ export const useUploadFile = () => {
|
||||
});
|
||||
}
|
||||
return ret?.data?.code;
|
||||
} catch (error) {}
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@@ -213,7 +215,6 @@ export const useFetchFileList = () => {
|
||||
};
|
||||
|
||||
export const useDeleteFile = () => {
|
||||
const { setPaginationParams } = useSetPaginationParams();
|
||||
const queryClient = useQueryClient();
|
||||
const { t } = useTranslation();
|
||||
|
||||
@@ -229,11 +230,10 @@ export const useDeleteFile = () => {
|
||||
});
|
||||
if (data.code === 0) {
|
||||
message.success(t('message.deleted'));
|
||||
setPaginationParams(1); // TODO: There should be a better way to paginate the request list
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [FileApiAction.FetchFileList],
|
||||
});
|
||||
}
|
||||
queryClient.invalidateQueries({
|
||||
queryKey: [FileApiAction.FetchFileList],
|
||||
});
|
||||
return data.code;
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user