Skip to content

Commit

Permalink
Fixed saving to api issue
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-flynn committed Mar 22, 2024
1 parent 731bc92 commit fbeac34
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 184 deletions.
11 changes: 8 additions & 3 deletions front-end/src/api/use-tournament-data.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
import { apiFetcher, clientFetcher } from '@toa-lib/client';
import { Tournament, tournamentZod } from '@toa-lib/models';
import { Tournament, toTournamentJSON, tournamentZod } from '@toa-lib/models';
import useSWR from 'swr';

export const postTournaments = async (
tournaments: Tournament[]
): Promise<void> => clientFetcher('tournament', 'POST', tournaments);
): Promise<void> =>
clientFetcher(
'tournament',
'POST',
tournaments.map((t) => toTournamentJSON(t))
);

export const patchTournament = async (tournament: Tournament): Promise<void> =>
clientFetcher(
`tournament/${tournament.eventKey}/${tournament.tournamentKey}`,
'POST',
tournament
toTournamentJSON(tournament)
);

export const useTournamentsForEvent = (eventKey: string | null | undefined) =>
Expand Down
39 changes: 0 additions & 39 deletions front-end/src/apps/TournamentManager/TournamentManager.tsx

This file was deleted.

139 changes: 0 additions & 139 deletions front-end/src/apps/TournamentManager/components/Tournaments.tsx

This file was deleted.

3 changes: 0 additions & 3 deletions front-end/src/apps/TournamentManager/index.ts

This file was deleted.

0 comments on commit fbeac34

Please sign in to comment.