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:
buua436
2026-04-30 11:00:39 +08:00
committed by GitHub
parent 811e9826d0
commit 47129fdd08
6 changed files with 85 additions and 29 deletions

View File

@@ -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;
},
});