util functions for fetching archived games

This commit is contained in:
Nathaniel Tampus
2023-04-02 12:36:48 +08:00
parent 75eb21c337
commit c7f3abf29c
3 changed files with 32 additions and 6 deletions

View File

@@ -1,9 +1,9 @@
import GameAuthWrapper from "@/components/game/GameAuthWrapper";
import { getGame } from "@/lib/game";
import { getActiveGame } from "@/lib/game";
import { notFound } from "next/navigation";
export async function generateMetadata({ params }: { params: { code: string } }) {
const game = await getGame(params.code);
const game = await getActiveGame(params.code);
if (!game) {
return {
description: "Game not found",
@@ -35,7 +35,7 @@ export async function generateMetadata({ params }: { params: { code: string } })
}
export default async function Game({ params }: { params: { code: string } }) {
const game = await getGame(params.code);
const game = await getActiveGame(params.code);
if (!game) {
notFound();
}