When deleting tournament, also delete cache Closes #1800

This commit is contained in:
Kalle
2024-07-08 10:35:42 +03:00
parent 00dc2c88ae
commit c0967cebbc

View File

@@ -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);
};