From aadbf4bcbcf2b0f49d16d8ea0c74069ce80fb480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o?= <43091603+glazk0@users.noreply.github.com> Date: Sun, 26 Feb 2023 19:23:51 +0100 Subject: [PATCH] Fix static issue --- app/dashboard/puzzles/[id]/page.tsx | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/app/dashboard/puzzles/[id]/page.tsx b/app/dashboard/puzzles/[id]/page.tsx index 58687ad..2178c0f 100644 --- a/app/dashboard/puzzles/[id]/page.tsx +++ b/app/dashboard/puzzles/[id]/page.tsx @@ -1,13 +1,10 @@ -import { getPuzzle, getPuzzles } from '@/lib/puzzles'; +import { getPuzzle } from '@/lib/puzzles'; import Puzzle from '@/ui/Puzzle'; import { notFound } from 'next/navigation'; -export async function generateMetadata({ - params -}: { - params: { id: number }; - searchParams: URLSearchParams; -}) { +// eslint-disable-next-line @typescript-eslint/ban-ts-comment +// @ts-ignore +export async function generateMetadata({ params }: { params: { id: number } }) { const { id } = params; const puzzle = await getPuzzle(id); @@ -27,8 +24,8 @@ export default async function Page({ params }: { params: { id: number } }) { return ; } -export async function generateStaticParams() { - const { puzzles } = await getPuzzles(); - // every id is a number, but we need to return a string - return puzzles.map((puzzle) => ({ id: puzzle.id.toString() })); -} +// export async function generateStaticParams() { +// const { puzzles } = await getPuzzles(); +// // every id is a number, but we need to return a string +// return puzzles.map((puzzle) => ({ id: puzzle.id.toString() })); +// }