From edf55abb9f1e9bae035cec32edd36a584e4bf55e Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Sat, 8 Mar 2025 09:57:43 +0200 Subject: [PATCH] Also show friendly error toast if trying to take same team name as existing team name --- app/features/tournament/actions/to.$id.register.server.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/features/tournament/actions/to.$id.register.server.ts b/app/features/tournament/actions/to.$id.register.server.ts index 1d772b3c0..a200870b0 100644 --- a/app/features/tournament/actions/to.$id.register.server.ts +++ b/app/features/tournament/actions/to.$id.register.server.ts @@ -73,6 +73,12 @@ export const action: ActionFunction = async ({ request, params }) => { tournament.registrationOpen || data.teamName === ownTeam.name, "Can't change team name after registration has closed", ); + errorToastIfFalsy( + !tournament.ctx.teams.some( + (team) => team.name === data.teamName && team.id !== ownTeam.id, + ), + "Team name already taken for this tournament", + ); await TournamentTeamRepository.update({ userId: user.id,