Commit 2aaad5b2 by Arjun Jhukal

updated the new static generation for the exclusive game

parent bb0be8c7
import ExclusiveGameDetail from "@/components/pages/dashboard/userDashboard/games/exclusiveGames/exclusiveGameDetail";
import { getSingleGame } from "@/serverApi/game";
import { getAllGames, getSingleGame } from "@/serverApi/game";
import { Metadata } from "next";
const SITE_URL = process.env.NEXT_PUBLIC_FRONTEND_URL!;
......@@ -27,6 +27,20 @@ export async function generateMetadata(props: { params: Promise<{ id: string }>
},
};
}
export async function generateStaticParams() {
const res = await getAllGames()
const games = res?.data?.data ?? []
return games.map((game: any) => ({
id: String(game.id),
}))
}
export const dynamic = 'force-static'
export default async function UserGameDetail(props: { params: Promise<{ id: string }> }) {
const { id } = await props.params;
......@@ -35,3 +49,8 @@ export default async function UserGameDetail(props: { params: Promise<{ id: stri
return <ExclusiveGameDetail game={game} />
}
// export default async function ExclusiveGamePage({ params }: PageProps) {
// const game = await getSingleGame(params.id)
// return <ExclusiveGameDetail game={game} />
// }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment