Refetching/revalidating server query with TRPC
[Nextjs 14 app Dir]
Hello, i want to revalidate my query after form sumit but for some reason i dont know what am i doing wrong. As im newbie in trpc i want to just revalidate specified request "onSuccess" after mutation but it doesnt work.
Thats the code:
Here im fetching card of user (with .query),
then im passing it to CardStylesStoreProvider where im creating zustand store with that:
Lastly onsubmit im updating my DB with data and want to revalidate this previous request but for some reason it doesnt work.. When i change route and back im getting old state (it only works on total F5 reload)
Hello, i want to revalidate my query after form sumit but for some reason i dont know what am i doing wrong. As im newbie in trpc i want to just revalidate specified request "onSuccess" after mutation but it doesnt work.
Thats the code:
Here im fetching card of user (with .query),
then im passing it to CardStylesStoreProvider where im creating zustand store with that:
Lastly onsubmit im updating my DB with data and want to revalidate this previous request but for some reason it doesnt work.. When i change route and back im getting old state (it only works on total F5 reload)