Skip to content

Commit 9a50986

Browse files
committed
fix duplicate invalidation
1 parent 210b6fd commit 9a50986

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

packages/ra-core/src/dataProvider/useMutationWithMutationMode.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ export const useMutationWithMutationMode = <
192192
mode.current === 'optimistic' ||
193193
mode.current === 'undoable'
194194
) {
195-
const [, , variables, onMutateResult] = args;
195+
const [, , variables] = args;
196196

197197
// Always refetch after error or success:
198198
getQueryKeysEvent(
@@ -203,11 +203,6 @@ export const useMutationWithMutationMode = <
203203
).forEach(queryKey => {
204204
queryClient.invalidateQueries({ queryKey });
205205
});
206-
(onMutateResult as { snapshot: Snapshot }).snapshot.forEach(
207-
([queryKey]) => {
208-
queryClient.invalidateQueries({ queryKey });
209-
}
210-
);
211206
}
212207

213208
if (callTimeOnSettled.current) {

0 commit comments

Comments
 (0)