fix: conform moved code to eslint indent/quotes, 4-arg mutation callbacks

- eslint --fix on branch-changed backend files (indent shift from the
  module-wrapper nesting in decomposed files); backend lint now 904
  errors vs 1,315 on main
- useMutationWithToast forwards all four TanStack v5 callback args
  (tsc -b strict build flagged the 3-arg passthrough)
This commit is contained in:
Paul Nothaft
2026-07-03 08:17:14 +02:00
parent b5eafc52bd
commit 2ea26a4962
25 changed files with 2272 additions and 2272 deletions
+4 -4
View File
@@ -47,7 +47,7 @@ export function useMutationWithToast<
return useMutation<TData, TError, TVariables, TContext>({
...mutationOptions,
onSuccess: (data, variables, context) => {
onSuccess: (data, variables, onMutateResult, context) => {
invalidateKeys?.forEach((queryKey) => {
queryClient.invalidateQueries({ queryKey });
});
@@ -56,9 +56,9 @@ export function useMutationWithToast<
typeof successMessage === 'function' ? successMessage(data, variables) : successMessage
);
}
onSuccess?.(data, variables, context);
onSuccess?.(data, variables, onMutateResult, context);
},
onError: (error, variables, context) => {
onError: (error, variables, onMutateResult, context) => {
const message =
typeof errorMessage === 'function'
? errorMessage(error)
@@ -67,7 +67,7 @@ export function useMutationWithToast<
(error instanceof Error ? error.message : undefined) ||
'An unexpected error occurred';
toast.error(message);
onError?.(error, variables, context);
onError?.(error, variables, onMutateResult, context);
},
});
}