mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-25 20:50:14 -05:00
Fail MATCH_UP if one group already matched up
This commit is contained in:
@@ -140,6 +140,10 @@ export const action: ActionFunction = async ({ request, context }) => {
|
||||
validateIsGroupAdmin();
|
||||
const groupToMatchUpWith = await LFGGroup.findById(data.targetGroupId);
|
||||
validate(groupToMatchUpWith, "Invalid targetGroupId");
|
||||
validate(!ownGroup.matchId, "Already matched up");
|
||||
|
||||
// fail silently if already matched up
|
||||
if (groupToMatchUpWith.matchId) break;
|
||||
|
||||
await LFGGroup.matchUp({
|
||||
groupIds: [ownGroup.id, data.targetGroupId],
|
||||
|
||||
Reference in New Issue
Block a user