Skip to content

Commit

Permalink
convert number from settings input
Browse files Browse the repository at this point in the history
  • Loading branch information
craigkai committed Jan 24, 2024
1 parent f142c7b commit 5032230
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/lib/components/tournament/Match.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
match = await matches.update(match);
success(`Match ${match.matches_team1_fkey.name} vs ${match.matches_team2_fkey.name} updated`);
} catch (err: any) {
console.error(err);
error(err?.body?.message ?? `Something went wrong: ${err}`);
}
}
Expand Down
13 changes: 10 additions & 3 deletions src/lib/components/tournament/Settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
export let event_id: number | string;
async function createNewEvent(): Promise<void> {
tournament.courts = Number(tournament.courts);
tournament.pools = Number(tournament.pools);
tournament
.create(tournament)
.then(async () => {
Expand All @@ -30,15 +33,19 @@
}
async function updateTournament(): Promise<void> {
tournament.courts = Number(tournament.courts);
tournament.pools = Number(tournament.pools);
tournament
.update(tournament.id, tournament)
.then((res: Event) => {
tournament = res;
success(`Tournament settings updated`);
})
.catch((err: { body: { message: string | SvelteToastOptions } }) =>
error(err?.body?.message)
);
.catch((err) => {
console.error(err);
error(err.body?.message ?? `Something went wrong: ${err}`);
});
}
async function deleteEvent(): Promise<void> {
Expand Down

1 comment on commit 5032230

@vercel
Copy link

@vercel vercel bot commented on 5032230 Jan 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

volleyman – ./

volleyman-craigkai.vercel.app
volleyman-git-main-craigkai.vercel.app
volleyman.vercel.app

Please sign in to comment.