Next.js Discord

Discord Forum

Revalidating path

Unanswered
American Pipit posted this in #help-forum
Open in Discord
American PipitOP
Hello, in a server component I am running a server action on /employer/[id]/create-job path, which calls a function createJob inserts a row into jobs table through supabase API. The function then redirects the user back to /employer/[id], where all jobs are listed. However, when I create a new job, and then redirect back, it doesn't show on /employer/[id] path, but when I reload the page, it is shown. How do I revalidate that path so that it shows right after I redirect the user back? Also, why does that happen? Doesn't it refetch after my function redirects the user back? If so, how do I revalidate the query results?

0 Replies