useUpdate
In the refine documentation about useUpdate, it says there is an onSuccess inside mutationOptions, but I am unable to use this method. Is there a way to execute an action only if the mutate returns a success?
I am using useUpdate as follows:
const { mutate: updateIvr } = useUpdate();
const handleSaveButton = (e: React.MouseEvent<HTMLButtonElement>) => {
const ivr = {
ivr: record.id,
ivr_tree: record.ivr_tree,
};
updateIvr({
resource: "updateIvrDev",
id: ivr.ivr,
values: ivr,
});
};
I am using useUpdate as follows:
const { mutate: updateIvr } = useUpdate();
const handleSaveButton = (e: React.MouseEvent<HTMLButtonElement>) => {
const ivr = {
ivr: record.id,
ivr_tree: record.ivr_tree,
};
updateIvr({
resource: "updateIvrDev",
id: ivr.ivr,
values: ivr,
});
};
