diff --git a/app/models/game.server.ts b/app/models/game.server.ts index e0c28c2c..849b9153 100644 --- a/app/models/game.server.ts +++ b/app/models/game.server.ts @@ -253,15 +253,13 @@ export async function getGames( search: string | null; }, accessToken?: AuthSession["accessToken"] -): Promise { +) { const { search, page } = options; const { from, to } = getPagination(page); let query = getSupabase(accessToken) - .from<"games", GameTable>("games") - .select<"*, categories ( *, clues ( * ) )", GameAndClues>( - "*, categories ( *, clues ( * ) )" - ) + .from("games") + .select() .order("created_at", { ascending: false }) .range(from, to); @@ -288,7 +286,7 @@ export async function getGames( throw new Error(error.message); } - return data.map((gac) => dbGameToGame(gac)); + return data; } /* Writes */ diff --git a/app/routes/_index/game-card.tsx b/app/routes/_index/game-card.tsx index 0314137e..05799a2f 100644 --- a/app/routes/_index/game-card.tsx +++ b/app/routes/_index/game-card.tsx @@ -3,17 +3,15 @@ import * as React from "react"; import { GameVisibilityTag } from "~/components/game-visibility-icon"; import { LoadingSpinner } from "~/components/icons"; -import type { Game } from "~/models/game.server"; +import type { DbGame } from "~/models/game.server"; export default function GameCard({ game, solo, }: { - game: Game; + game: DbGame; solo: boolean; }) { - const numRounds = game.boards.length; - const [loading, setLoading] = React.useState(false); const to = solo ? `/game/${game.id}/solo` : `/game/${game.id}/play`; @@ -46,16 +44,6 @@ export default function GameCard({ {game.visibility !== "PUBLIC" && ( )} -

- {numRounds} {numRounds === 1 ? "round" : "rounds"} ( - {game.boards - .map( - (b) => - `${b.categories.length}x${b.categories[0].clues.length}` - ) - .join(", ")} - ) -