Next.js Discord

Discord Forum

Revalidation doesn't work.

Unanswered
Pacific herring posted this in #help-forum
Open in Discord
Avatar
Pacific herringOP
My Dashboard:

export const dynamic = "force-dynamic";
export const dynamicParams = true;
export const revalidate = false;

export default async function Dashboard() {
  const session = await getServerAuthSession();
  const apps = await getUserApps(session!.user!.id!);
  console.log(apps);

  return (
    <div className="flex flex-col">
      {apps?.map((app, index) => (
        {/* App Card */}
      ))}
    </div>
  );
}


Route for creating a new app:
export async function POST(req: NextRequest) {
  // Here it created the new app

  revalidatePath("/dashboard");
  return NextResponse.json({});
}

0 Replies