mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-07-16 00:14:21 -05:00
Also show friendly error toast if trying to take same team name as existing team name
This commit is contained in:
parent
273b3dce9c
commit
edf55abb9f
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user