Fix static issue
This commit is contained in:
parent
1318c39840
commit
aadbf4bcbc
1 changed files with 9 additions and 12 deletions
|
@ -1,13 +1,10 @@
|
||||||
import { getPuzzle, getPuzzles } from '@/lib/puzzles';
|
import { getPuzzle } from '@/lib/puzzles';
|
||||||
import Puzzle from '@/ui/Puzzle';
|
import Puzzle from '@/ui/Puzzle';
|
||||||
import { notFound } from 'next/navigation';
|
import { notFound } from 'next/navigation';
|
||||||
|
|
||||||
export async function generateMetadata({
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||||
params
|
// @ts-ignore
|
||||||
}: {
|
export async function generateMetadata({ params }: { params: { id: number } }) {
|
||||||
params: { id: number };
|
|
||||||
searchParams: URLSearchParams;
|
|
||||||
}) {
|
|
||||||
const { id } = params;
|
const { id } = params;
|
||||||
|
|
||||||
const puzzle = await getPuzzle(id);
|
const puzzle = await getPuzzle(id);
|
||||||
|
@ -27,8 +24,8 @@ export default async function Page({ params }: { params: { id: number } }) {
|
||||||
return <Puzzle puzzle={puzzle} />;
|
return <Puzzle puzzle={puzzle} />;
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function generateStaticParams() {
|
// export async function generateStaticParams() {
|
||||||
const { puzzles } = await getPuzzles();
|
// const { puzzles } = await getPuzzles();
|
||||||
// every id is a number, but we need to return a string
|
// // every id is a number, but we need to return a string
|
||||||
return puzzles.map((puzzle) => ({ id: puzzle.id.toString() }));
|
// return puzzles.map((puzzle) => ({ id: puzzle.id.toString() }));
|
||||||
}
|
// }
|
||||||
|
|
Loading…
Add table
Reference in a new issue