Backend check that can't register as sub if already in a team

This commit is contained in:
Kalle 2024-04-22 21:56:28 +03:00
parent c2ed3ad985
commit ba05ae0ed6

View File

@ -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(","),