graceful-blue
graceful-blue2y ago

custom success notification for useUpdate hook

i want my custom sucess notification for use update hook useUpdate({ successNotifiacation:{ message:"ddd", description:"dddd" } }) this way its not working
2 Replies
fascinating-indigo
fascinating-indigo2y ago
Hey @rehan1, I reproduced your issue and I created a custom notification without any problem. You must pass the type parameter to the successNotifiacation. Can you try this code and tell me if it works for you?
successNotification: {
message: "Custom message",
type: "success",
description: "Custom description",
},
successNotification: {
message: "Custom message",
type: "success",
description: "Custom description",
},
By the way, you can pass the successNotification to useUpdate's mutate function not useUpdate. Just like this:
const { mutate } = useUpdate({ ... });

mutate({
successNotification: {...}
});
const { mutate } = useUpdate({ ... });

mutate({
successNotification: {...}
});
graceful-blue
graceful-blue2y ago
yeah it worked thanks