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

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

View File

@@ -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 (
<div className="flex flex-col items-center">