rename "get" util functions to "fetch"

This commit is contained in:
Nathaniel Tampus
2023-04-07 12:09:10 +08:00
parent 44af7ed0ae
commit a2bae7201d
6 changed files with 14 additions and 14 deletions

View File

@@ -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();
}

View File

@@ -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();
}