Skip to content

Commit 2201b12

Browse files
committed
Improve DeleteWithConfirmButton
1 parent 1e9f3db commit 2201b12

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/ra-ui-materialui/src/button/DeleteWithConfirmButton.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,11 +96,12 @@ export const DeleteWithConfirmButton = <RecordType extends RaRecord = any>(
9696
redirect(redirectTo, resource);
9797
}
9898
},
99-
onError: (error, variables, onMutateResult, context) => {
99+
onError: (...args) => {
100100
setOpen(false);
101101
if (onError) {
102-
onError(error, variables, onMutateResult, context);
102+
onError(...args);
103103
} else {
104+
const [error] = args;
104105
notify(
105106
typeof error === 'string'
106107
? error

0 commit comments

Comments
 (0)