From f1642d6b45f8d4b09fdc46a8c7991eae3b582080 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:15:30 +0300 Subject: [PATCH] Check that groups are full before making a match --- app/features/sendouq/routes/q.looking.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/features/sendouq/routes/q.looking.tsx b/app/features/sendouq/routes/q.looking.tsx index 41b9aca34..ae7127236 100644 --- a/app/features/sendouq/routes/q.looking.tsx +++ b/app/features/sendouq/routes/q.looking.tsx @@ -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,