Skip to content

Commit ca228a4

Browse files
committed
Ensure users can still override only parts of the mutationOptions
1 parent 59c6dca commit ca228a4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/ra-core/src/controller/button/useDeleteWithConfirmController.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ const useDeleteWithConfirmController = <
7979
record,
8080
redirect: redirectTo = 'list',
8181
successMessage,
82+
mutationOptions = {},
83+
...rest
8284
} = props;
8385
const [open, setOpen] = useState(false);
8486
const resource = useResourceContext(props);
@@ -89,6 +91,7 @@ const useDeleteWithConfirmController = <
8991

9092
const { isPending, handleDelete: controllerHandleDelete } =
9193
useDeleteController({
94+
mutationMode,
9295
mutationOptions: {
9396
onSuccess: () => {
9497
setOpen(false);
@@ -130,8 +133,12 @@ const useDeleteWithConfirmController = <
130133
}
131134
);
132135
},
136+
...mutationOptions,
133137
},
134-
...props,
138+
record,
139+
redirect: redirectTo,
140+
successMessage,
141+
...rest,
135142
});
136143

137144
const handleDialogOpen = useEvent((e: any) => {

0 commit comments

Comments
 (0)