From f8bd7daf330a2890b13c1c6edb698a8164970d92 Mon Sep 17 00:00:00 2001 From: Samet Date: Thu, 27 Apr 2023 01:37:56 +0300 Subject: [PATCH] feat(#186): configured static params for build lists --- app/build/[...ids]/page.tsx | 7 +++++++ app/build/list/page.tsx | 2 ++ 2 files changed, 9 insertions(+) diff --git a/app/build/[...ids]/page.tsx b/app/build/[...ids]/page.tsx index 352ef54..a608015 100644 --- a/app/build/[...ids]/page.tsx +++ b/app/build/[...ids]/page.tsx @@ -1,3 +1,10 @@ +export const dynamic = "force-static"; + +export async function generateStaticParams() { + const queries = await prisma.platformQuery.findMany({ select: { id: true } }); + return queries.map((query) => ({ ids: [query.id] })); +} + import { getServerSession } from "next-auth/next"; import { authOptions } from "@/pages/api/auth/[...nextauth]"; import { validations } from "@/platforms"; diff --git a/app/build/list/page.tsx b/app/build/list/page.tsx index 4e94b0f..56621e3 100644 --- a/app/build/list/page.tsx +++ b/app/build/list/page.tsx @@ -1,3 +1,5 @@ +export const dynamic = "force-static"; + import prisma from "@/services/prisma"; import { Platform, PlatformCode, PlatformQuery } from "@prisma/client"; import { templates, samples } from "@/platforms";