Skip to content

Commit

Permalink
Merge pull request #188 from sametcodes/186-make-listing-page-increme…
Browse files Browse the repository at this point in the history
…ntally-static

feat(#186): configured static params for build lists
  • Loading branch information
sametcodes authored Apr 26, 2023
2 parents 82f757c + f8bd7da commit ccc0bd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/build/[...ids]/page.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
2 changes: 2 additions & 0 deletions app/build/list/page.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down

0 comments on commit ccc0bd4

Please sign in to comment.