From c0967cebbc3631d5fb3725239f0c65a55d53db75 Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 8 Jul 2024 10:35:42 +0300 Subject: [PATCH] When deleting tournament, also delete cache Closes #1800 --- app/features/calendar/routes/calendar.$id.tsx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/features/calendar/routes/calendar.$id.tsx b/app/features/calendar/routes/calendar.$id.tsx index b1f89995d..b4bf8c4fa 100644 --- a/app/features/calendar/routes/calendar.$id.tsx +++ b/app/features/calendar/routes/calendar.$id.tsx @@ -24,6 +24,7 @@ import { useUser } from "~/features/auth/core/user"; import { requireUserId } from "~/features/auth/core/user.server"; import * as CalendarRepository from "~/features/calendar/CalendarRepository.server"; import { MapPool } from "~/features/map-list-generator/core/map-pool"; +import { clearTournamentDataCache } from "~/features/tournament-bracket/core/Tournament.server"; import { useIsMounted } from "~/hooks/useIsMounted"; import { i18next } from "~/modules/i18n/i18next.server"; import { @@ -77,6 +78,10 @@ export const action: ActionFunction = async ({ params, request }) => { tournamentId: event.tournamentId, }); + if (event.tournamentId) { + clearTournamentDataCache(event.tournamentId); + } + throw redirect(CALENDAR_PAGE); };