From 4b1af3a16698e8fcfa01fde8740479bde0c97e38 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Tue, 15 Aug 2023 01:12:56 +0300 Subject: [PATCH] Cancel match working for real now hopefully --- app/features/sendouq/routes/q.match.$id.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/features/sendouq/routes/q.match.$id.tsx b/app/features/sendouq/routes/q.match.$id.tsx index d60dc22cb..5de516b04 100644 --- a/app/features/sendouq/routes/q.match.$id.tsx +++ b/app/features/sendouq/routes/q.match.$id.tsx @@ -198,8 +198,8 @@ export const action = async ({ request, params }: ActionArgs) => { case "CANCEL_MATCH": { const match = notFoundIfFalsy(findMatchById(matchId)); validate( - !match.reportedByUserId, - "Match has already been reported by at least one team" + !match.isLocked, + "Match has already been reported by both teams" ); validate(isAdmin(user), "Only admin can cancel the match"); @@ -209,6 +209,7 @@ export const action = async ({ request, params }: ActionArgs) => { reportedByUserId: user.id, winners: [], }); + deleteReporterWeaponsByMatchId(matchId); setGroupAsInactive(match.alphaGroupId); setGroupAsInactive(match.bravoGroupId); addDummySkill(match.id); @@ -418,7 +419,7 @@ export default function QMatchPage() { ) : null} ) : null} - {isAdmin(user) && !data.match.reportedByUserId ? ( + {isAdmin(user) && !data.match.isLocked ? (