diff --git a/client/src/app/[code]/page.tsx b/client/src/app/[code]/page.tsx index a18a50e..636f051 100644 --- a/client/src/app/[code]/page.tsx +++ b/client/src/app/[code]/page.tsx @@ -1,9 +1,9 @@ import GameAuthWrapper from "@/components/game/GameAuthWrapper"; -import { getActiveGame } from "@/lib/game"; +import { fetchActiveGame } from "@/lib/game"; import { notFound } from "next/navigation"; export async function generateMetadata({ params }: { params: { code: string } }) { - const game = await getActiveGame(params.code); + const game = await fetchActiveGame(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 getActiveGame(params.code); + const game = await fetchActiveGame(params.code); if (!game) { notFound(); } diff --git a/client/src/app/archive/[id]/page.tsx b/client/src/app/archive/[id]/page.tsx index cce348e..a1c5dde 100644 --- a/client/src/app/archive/[id]/page.tsx +++ b/client/src/app/archive/[id]/page.tsx @@ -1,10 +1,10 @@ import ArchivedGame from "@/components/archive/ArchivedGame"; -import { getArchivedGame } from "@/lib/game"; +import { fetchArchivedGame } from "@/lib/game"; import type { Game } from "@chessu/types"; import { notFound } from "next/navigation"; export async function generateMetadata({ params }: { params: { id: number } }) { - const game = (await getArchivedGame({ id: params.id })) as Game | undefined; + const game = (await fetchArchivedGame({ id: params.id })) as Game | undefined; if (!game) { return { description: "Game not found", @@ -36,7 +36,7 @@ export async function generateMetadata({ params }: { params: { id: number } }) { } export default async function Archive({ params }: { params: { id: number } }) { - const game = (await getArchivedGame({ id: params.id })) as Game | undefined; + const game = (await fetchArchivedGame({ id: params.id })) as Game | undefined; if (!game) { notFound(); } diff --git a/client/src/components/home/JoinGame.tsx b/client/src/components/home/JoinGame.tsx index c8b2d33..ce9b6eb 100644 --- a/client/src/components/home/JoinGame.tsx +++ b/client/src/components/home/JoinGame.tsx @@ -3,7 +3,7 @@ import type { FormEvent } from "react"; import { useState, useContext } from "react"; import { SessionContext } from "@/context/session"; -import { getActiveGame } from "@/lib/game"; +import { fetchActiveGame } from "@/lib/game"; import { useRouter } from "next/navigation"; export default function JoinGame() { @@ -31,7 +31,7 @@ export default function JoinGame() { code = new URL(code).pathname.split("/")[1]; } - const game = await getActiveGame(code); + const game = await fetchActiveGame(code); if (game && game.code) { router.push(`/${game.code}`); diff --git a/client/src/components/home/PublicGames/PublicGames.tsx b/client/src/components/home/PublicGames/PublicGames.tsx index c85ea70..067b6bd 100644 --- a/client/src/components/home/PublicGames/PublicGames.tsx +++ b/client/src/components/home/PublicGames/PublicGames.tsx @@ -1,9 +1,9 @@ -import { getPublicGames } from "@/lib/game"; +import { fetchPublicGames } from "@/lib/game"; import JoinButton from "./JoinButton"; import RefreshButton from "./RefreshButton"; export default async function PublicGames() { - const games = await getPublicGames(); + const games = await fetchPublicGames(); return (