Don't check group status when reporting score

This commit is contained in:
Kalle 2022-02-26 13:48:09 +02:00
parent e07fff02b0
commit c11d7a4042

View File

@ -97,12 +97,14 @@ export const action: ActionFunction = async ({
g.members.some((m) => m.memberId === user.id)
);
validate(ownGroup, "Not own match");
validate(ownGroup.status === "MATCH", "Group doesn't have a match");
validate(isGroupAdmin({ group: ownGroup, user }), "Not group admin");
switch (data._action) {
case "REPORT_SCORE": {
if (match.stages.some((stage) => stage.winnerGroupId)) {
const matchWasAlreadyReported = match.stages.some(
(stage) => stage.winnerGroupId
);
if (matchWasAlreadyReported) {
// just don't do anything if they report same as someone else before them
// to user it looks identical to if they were the first to submit
if (