diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-08-01 22:22:12 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-08-01 22:22:12 +0900 |
| commit | 8f2cceacc8fde328033de7f05bb12e7b1246dd86 (patch) | |
| tree | acb93a52454315c286b9e0f3c624ae1bbcfa32f5 /frontend/app/routes/admin.games.tsx | |
| parent | 00e50b2dcfed209669c46da54dc07905d65887b8 (diff) | |
| download | phperkaigi-2025-albatross-8f2cceacc8fde328033de7f05bb12e7b1246dd86.tar.gz phperkaigi-2025-albatross-8f2cceacc8fde328033de7f05bb12e7b1246dd86.tar.zst phperkaigi-2025-albatross-8f2cceacc8fde328033de7f05bb12e7b1246dd86.zip | |
chore(frontend): [biome] format
Diffstat (limited to 'frontend/app/routes/admin.games.tsx')
| -rw-r--r-- | frontend/app/routes/admin.games.tsx | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/frontend/app/routes/admin.games.tsx b/frontend/app/routes/admin.games.tsx index adba7f5..af3554e 100644 --- a/frontend/app/routes/admin.games.tsx +++ b/frontend/app/routes/admin.games.tsx @@ -4,37 +4,37 @@ import { adminApiGetGames } from "../.server/api/client"; import { isAuthenticated } from "../.server/auth"; export const meta: MetaFunction = () => { - return [{ title: "[Admin] Games | iOSDC Japan 2024 Albatross.swift" }]; + return [{ title: "[Admin] Games | iOSDC Japan 2024 Albatross.swift" }]; }; export async function loader({ request }: LoaderFunctionArgs) { - const { user, token } = await isAuthenticated(request, { - failureRedirect: "/login", - }); - if (!user.is_admin) { - throw new Error("Unauthorized"); - } - const { games } = await adminApiGetGames(token); - return { games }; + const { user, token } = await isAuthenticated(request, { + failureRedirect: "/login", + }); + if (!user.is_admin) { + throw new Error("Unauthorized"); + } + const { games } = await adminApiGetGames(token); + return { games }; } export default function AdminGames() { - const { games } = useLoaderData<typeof loader>()!; + const { games } = useLoaderData<typeof loader>()!; - return ( - <div> - <div> - <h1>[Admin] Games</h1> - <ul> - {games.map((game) => ( - <li key={game.game_id}> - <Link to={`/admin/games/${game.game_id}`}> - {game.display_name} (id={game.game_id}) - </Link> - </li> - ))} - </ul> - </div> - </div> - ); + return ( + <div> + <div> + <h1>[Admin] Games</h1> + <ul> + {games.map((game) => ( + <li key={game.game_id}> + <Link to={`/admin/games/${game.game_id}`}> + {game.display_name} (id={game.game_id}) + </Link> + </li> + ))} + </ul> + </div> + </div> + ); } |
