From ba05ae0ed6ce150ec9002e64a5de8d439ee55943 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 22 Apr 2024 21:56:28 +0300 Subject: [PATCH] Backend check that can't register as sub if already in a team --- app/features/tournament-subs/routes/to.$id.subs.new.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/features/tournament-subs/routes/to.$id.subs.new.tsx b/app/features/tournament-subs/routes/to.$id.subs.new.tsx index 3aae2db14..88eba5557 100644 --- a/app/features/tournament-subs/routes/to.$id.subs.new.tsx +++ b/app/features/tournament-subs/routes/to.$id.subs.new.tsx @@ -49,6 +49,10 @@ export const action: ActionFunction = async ({ params, request }) => { tournament.canAddNewSubPost, "Registration is closed or subs feature disabled", ); + validate( + !tournament.teamMemberOfByUser(user), + "Can't register as a sub and be in a team at the same time", + ); upsertSub({ bestWeapons: data.bestWeapons.join(","),