Invalidate all routes #2567
Answered
by
schiller-manuel
merthanmerter
asked this question in
Q&A
-
Is there a way to invalidate all routes? My app is multitenant, when I change the tenant "activeTenant" in user data updates and session token refreshes. Then I navigate to root path. const changeActiveTenant = useMutation({
mutationFn: async (data: Pick<SelectTenant, "id">) => {
return await context.proxy.auth.changeActiveTenant.mutate(data);
},
onSuccess: async () => {
router.invalidate();
router.navigate({ to: "/hub" });
},
onError: (err) => {
toast.error(err.message);
},
}); This method only invalidates the current path that it is called, so this causes showing the old tenant data for a second before new data loads with Edit: |
Beta Was this translation helpful? Give feedback.
Answered by
schiller-manuel
Oct 17, 2024
Replies: 1 comment 2 replies
-
You are looking for a way to empty all cached matches. |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
merthanmerter
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You are looking for a way to empty all cached matches.
we don't have this yet, but this could be added