grumpy-cyan
grumpy-cyan2mo ago

***Hey Guys, how do I call apis which do

Hey Guys, how do I call apis which do not need id param? for example, let's say you log in to Amazon as a seller and want to change some settings. I got two APIs for this purpose. GET /seller_settings PATCH /seller_settings I can use the useCustom but it bypasses all the features of refine, I would have to invalidate the useCustom(GET /seller_settings) after the useCustomMutation(PATCH /seller_settings) manually, right? I cannot use the useUpdate and useOne or useShow, because they all need :id. for a resource such as seller_settings or any global config, you probably do not need the id param, in that case how do I use the data fetching capabilities of refine?
2 Replies
vicious-gold
vicious-gold2mo ago
Hello @AK, please ask this kind of questions on #ask-any-question channel. We want to make id optional in refine @5 but right now we need work around. useCustom is a option of course but its requires extra effort. also we have another option, you can pass empty string to id: "" and handle this situation on data-provider
xenial-black
xenial-black2mo ago
thank you,

Did you find this page helpful?