refactor: remove redundant document deletion logic and optimize cache updates

This commit is contained in:
Anish Sarkar 2026-02-04 17:27:40 +05:30
parent 878e829bdc
commit ab2896ec65
4 changed files with 9 additions and 64 deletions

View file

@ -95,7 +95,7 @@ export const deleteDocumentMutationAtom = atomWithMutation((get) => {
},
onSuccess: (_, request: DeleteDocumentRequest) => {
toast.success("Document deleted successfully");
// Note: Toast is handled by the caller (page.tsx onBulkDelete) to show count info
queryClient.setQueryData(
cacheKeys.documents.globalQueryParams(documentsQueryParams),
(oldData: GetDocumentsResponse | undefined) => {