Next.js Discord

Discord Forum

Data is cached when I make a POST adding a new item

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I've been dealing with this since 2 days ago, before it was working fine.

First I create a brand using the addBrand function under a "use client" page. As you can see in the first image. When the response is ok, it calls fetchCategories() function which is the function that gets me all the brands (this should bring the new added brand and its not bringing it).
This fetchCategories function lives in a zustand store as you can see on the second image.
And the store calls the api route tha is on the third image. I tried using export const revalidate=0; but its not working.

5 Replies

Asiatic LionOP
I just tried it and it did work. Meaning i got the new data