From 97c8c9e72b59d606579807ff83589c754c7084d6 Mon Sep 17 00:00:00 2001 From: yohlo Date: Thu, 11 Sep 2025 16:04:46 -0500 Subject: [PATCH] i think working bracket runner --- .../_authed/admin/tournaments/run.$id.tsx | 19 ------------------- .../bracket/components/match-card.tsx | 2 -- .../bracket/components/match-form.tsx | 2 -- src/features/matches/server.ts | 3 --- src/lib/pocketbase/services/matches.ts | 2 -- 5 files changed, 28 deletions(-) diff --git a/src/app/routes/_authed/admin/tournaments/run.$id.tsx b/src/app/routes/_authed/admin/tournaments/run.$id.tsx index e6fdfa3..2636879 100644 --- a/src/app/routes/_authed/admin/tournaments/run.$id.tsx +++ b/src/app/routes/_authed/admin/tournaments/run.$id.tsx @@ -40,17 +40,6 @@ export const Route = createFileRoute("/_authed/admin/tournaments/run/$id")({ function RouteComponent() { const { id } = Route.useParams(); const { data: tournament } = useTournament(id); - const queryClient = useQueryClient(); - - const start = useServerMutation({ - mutationFn: startMatch, - successMessage: "Match started!", - onSuccess: () => { - queryClient.invalidateQueries({ - queryKey: tournamentKeys.details(tournament.id), - }); - }, - }); const bracket: BracketData = useMemo(() => { if (!tournament.matches || tournament.matches.length === 0) { @@ -86,14 +75,6 @@ function RouteComponent() { return { winners, losers }; }, [tournament.matches]); - const handleStartMatch = async (match: Match) => { - await start.mutate({ - data: match.id - }) - }; - - console.log(tournament.matches); - return ( {tournament.matches?.length ? ( diff --git a/src/features/bracket/components/match-card.tsx b/src/features/bracket/components/match-card.tsx index f671203..f6377a8 100644 --- a/src/features/bracket/components/match-card.tsx +++ b/src/features/bracket/components/match-card.tsx @@ -91,8 +91,6 @@ export const MatchCard: React.FC = ({ [match.id, editSheet] ); - console.log(homeSlot, awaySlot) - return ( diff --git a/src/features/bracket/components/match-form.tsx b/src/features/bracket/components/match-form.tsx index acb82bd..bc8b839 100644 --- a/src/features/bracket/components/match-form.tsx +++ b/src/features/bracket/components/match-form.tsx @@ -76,8 +76,6 @@ export const MatchForm: React.FC = ({ onSubmit(transformedValues); }); - console.log(match) - return (
diff --git a/src/features/matches/server.ts b/src/features/matches/server.ts index 773cf19..8d94f82 100644 --- a/src/features/matches/server.ts +++ b/src/features/matches/server.ts @@ -181,9 +181,6 @@ export const endMatch = createServerFn() // winner -> where to send match winner to, loser same const { winner, loser } = await pbAdmin.getChildMatches(matchId) - - console.log('match winner:', matchWinner) - console.log('match loser:', matchLoser) if (winner) { await pbAdmin.updateMatch(winner.id, { diff --git a/src/lib/pocketbase/services/matches.ts b/src/lib/pocketbase/services/matches.ts index 3bc437c..94dfb33 100644 --- a/src/lib/pocketbase/services/matches.ts +++ b/src/lib/pocketbase/services/matches.ts @@ -27,8 +27,6 @@ export function createMatchesService(pb: PocketBase) { const winnerMatch = result.find(m => (m.home_from_lid === match.lid && !m.home_from_loser) || (m.away_from_lid === match.lid && !m.away_from_loser)); const loserMatch = result.find(m => (m.home_from_lid === match.lid && m.home_from_loser) || (m.away_from_lid === match.lid && m.away_from_loser)); - console.log(winnerMatch, loserMatch) - return { winner: winnerMatch ? transformMatch(winnerMatch) : undefined, loser: loserMatch ? transformMatch(loserMatch) : undefined