mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-08-21 18:44:51 -05:00
Hide UI and serverside check against adding a new team after tournament started
This commit is contained in:
@@ -11,7 +11,7 @@ import {
|
||||
import * as TournamentLFGRepository from "~/features/tournament-lfg/TournamentLFGRepository.server";
|
||||
import { parseFormDataWithImages } from "~/form/parse.server";
|
||||
import invariant from "~/utils/invariant";
|
||||
import { parseParams } from "~/utils/remix.server";
|
||||
import { errorToastIfFalsy, parseParams } from "~/utils/remix.server";
|
||||
import { tournamentAdminPage } from "~/utils/urls";
|
||||
import { idObject } from "~/utils/zod";
|
||||
import { adminRegistrationFormSchemaServer } from "../tournament-admin-registration-schemas.server";
|
||||
@@ -50,6 +50,8 @@ export const action: ActionFunction = async ({ request, params }) => {
|
||||
team = tournament.teamById(data.tournamentTeamId);
|
||||
}
|
||||
|
||||
errorToastIfFalsy(team || !tournament.hasStarted, "Tournament has started");
|
||||
|
||||
const currentMemberIds = team?.members.map((member) => member.userId) ?? [];
|
||||
const submittedMemberIds = submittedMembers.map((member) => member.userId);
|
||||
const membersToAdd = submittedMemberIds.filter(
|
||||
|
||||
@@ -72,7 +72,7 @@ export default function TournamentAdminTeamsPage() {
|
||||
>
|
||||
Export
|
||||
</SendouButton>
|
||||
{!tournament.ctx.isFinalized ? (
|
||||
{!tournament.hasStarted ? (
|
||||
<LinkButton
|
||||
size="small"
|
||||
icon={<Plus />}
|
||||
|
||||
Reference in New Issue
Block a user