i think working bracket runner
This commit is contained in:
@@ -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 (
|
||||
<Container size="md">
|
||||
{tournament.matches?.length ? (
|
||||
|
||||
Reference in New Issue
Block a user