rising-crimson
rising-crimson3y ago

Resource in useCustomMutation successNotification parameter

How do I access or pass a resource name into useCustomMutation? I use this hook to have a reordering feature on my list.tsx page, and when I have the code like on screenshot it gives resource undefined. What should I do to have resource correctly set? (Also, offtopic as a general wish: try to somehow migrate this whole "help" discord to github wiki or any other publicly available platform. Discord is not parsable through search engines, so first you loose developers attention when they try to find a solution, and at the same time you loose SEO points for being mentioned. )
No description
7 Replies
kapa.ai
kapa.ai3y ago
Sorry @metammodern, I am experiencing especially high traffic right now, please try again. :technologist:
absent-sapphire
absent-sapphire3y ago
useCustomMutation does not know current resource. our docs has wrong example. we will fix this https://refine.dev/docs/api-reference/core/hooks/data/useCustomMutation/#successnotification
rising-crimson
rising-crimsonOP3y ago
@arpentnoir yes, I'm aware of that, that's why I'm asking. How can I tell it the resource name? using useResource?
absent-sapphire
absent-sapphire3y ago
yes you can use useResource
rising-crimson
rising-crimsonOP3y ago
hm, okay. Thank you
absent-sapphire
absent-sapphire3y ago
btw @metammodern your suggestions is great but we need to discus technical details. can you write this on #ideas-and-suggestions channel ? or you can open github issue if you want
rising-crimson
rising-crimsonOP3y ago
Oh, alright, will do:) I will create it in github to also reflect this part of issue(redirecting users) okay look, I did it but when saving github showed me its stupid unicorn and now I'm pissed of. I'll create it later, I wrote a complete article on why this is wrong and now it is all flushed.

Did you find this page helpful?