other-emerald
other-emerald2y ago

useCreateMany

how to use onMutationSuccess in useCreateMany hook
2 Replies
continuing-cyan
continuing-cyan2y ago
Hey @rehan1, You can use like this:
const { mutate } = useCreateMany();

mutate(
{ resource: "YOUR-RESOURCE", values: [] },
{
onSuccess: () => {
// your logic in here
},
},
);
const { mutate } = useCreateMany();

mutate(
{ resource: "YOUR-RESOURCE", values: [] },
{
onSuccess: () => {
// your logic in here
},
},
);
other-emerald
other-emerald2y ago
👍