mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-30 07:12:36 -05:00
Clear tournament cache on sub post change to keep the number in tab in sync
This commit is contained in:
@@ -17,7 +17,10 @@ import { TrashIcon } from "~/components/icons/Trash";
|
||||
import { useUser } from "~/features/auth/core/user";
|
||||
import { requireUser } from "~/features/auth/core/user.server";
|
||||
import { tournamentIdFromParams } from "~/features/tournament";
|
||||
import { tournamentFromDB } from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import {
|
||||
clearTournamentDataCache,
|
||||
tournamentFromDB,
|
||||
} from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import type { MainWeaponId } from "~/modules/in-game-lists";
|
||||
import {
|
||||
type SendouRouteHandle,
|
||||
@@ -65,6 +68,8 @@ export const action: ActionFunction = async ({ params, request }) => {
|
||||
userId: user.id,
|
||||
});
|
||||
|
||||
clearTournamentDataCache(tournamentId);
|
||||
|
||||
throw redirect(tournamentSubsPage(tournamentId));
|
||||
};
|
||||
|
||||
|
||||
@@ -18,7 +18,10 @@ import { TrashIcon } from "~/components/icons/Trash";
|
||||
import { useUser } from "~/features/auth/core/user";
|
||||
import { getUser, requireUser } from "~/features/auth/core/user.server";
|
||||
import { tournamentIdFromParams } from "~/features/tournament";
|
||||
import { tournamentFromDB } from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import {
|
||||
clearTournamentDataCache,
|
||||
tournamentFromDB,
|
||||
} from "~/features/tournament-bracket/core/Tournament.server";
|
||||
import { useTournament } from "~/features/tournament/routes/to.$id";
|
||||
import { parseRequestPayload, validate } from "~/utils/remix.server";
|
||||
import { assertUnreachable } from "~/utils/types";
|
||||
@@ -52,6 +55,8 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
userId: data.userId,
|
||||
});
|
||||
|
||||
clearTournamentDataCache(tournamentId);
|
||||
|
||||
return null;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user