rename "get" util functions to "fetch"
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user