You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First, assume that two api exist.
One gets the foods from a path called /api/foods with GET.
The other one registers the food from a path called /api/foods with POST.
In this case, the following will delete the cache of the get api, which has the same key, after registering the food.
But I don't know how to make it work with one useSWRMutation when the keys are different.
If I want to also delete the cache of the api to get the vegetables(/api/vegetables), how do I do that?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
First, assume that two api exist.
One gets the foods from a path called
/api/foods
with GET.The other one registers the food from a path called
/api/foods
with POST.In this case, the following will delete the cache of the get api, which has the same key, after registering the food.
But I don't know how to make it work with one useSWRMutation when the keys are different.
If I want to also delete the cache of the api to get the vegetables(
/api/vegetables
), how do I do that?Beta Was this translation helpful? Give feedback.
All reactions