mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-10-01 07:37:55 -05:00
Check that groups are full before making a match
This commit is contained in:
@@ -204,6 +204,15 @@ export const action: ActionFunction = async ({ request }) => {
|
||||
);
|
||||
if (!theirGroup) return null;
|
||||
|
||||
validate(
|
||||
ourGroup.members.length === FULL_GROUP_SIZE,
|
||||
"'ourGroup' is not full"
|
||||
);
|
||||
validate(
|
||||
theirGroup.members.length === FULL_GROUP_SIZE,
|
||||
"'theirGroup' is not full"
|
||||
);
|
||||
|
||||
const createdMatch = createMatch({
|
||||
alphaGroupId: ourGroup.id,
|
||||
bravoGroupId: theirGroup.id,
|
||||
|
||||
Reference in New Issue
Block a user