Merge branch 'main' into feat-translation-3

This commit is contained in:
Inkorest
2026-06-18 18:17:20 +08:00
3 changed files with 15 additions and 5 deletions

View File

@@ -72,7 +72,9 @@ export default function TournamentAdminRegistrationPage() {
ownerId: owner ? String(owner.userId) : "",
members: team.members.map((member) => ({
userId: member.userId,
inGameName: member.inGameName ?? null,
inGameName: tournament.ctx.settings.requireInGameNames
? (member.inGameName ?? null)
: null,
})),
}
: undefined;

View File

@@ -4,7 +4,10 @@ import * as TeamRepository from "~/features/team/TeamRepository.server";
import { tournamentTeamNameTaken } from "~/features/tournament/tournament-utils.server";
import type { Tournament } from "~/features/tournament-bracket/core/Tournament";
import * as UserRepository from "~/features/user-page/UserRepository.server";
import { adminRegistrationFormSchema } from "./tournament-admin-registration-schemas";
import {
ADMIN_REGISTRATION_MAX_MEMBERS,
adminRegistrationFormSchema,
} from "./tournament-admin-registration-schemas";
/**
* Extends the client {@link adminRegistrationFormSchema} with server-only,
@@ -38,7 +41,7 @@ export function adminRegistrationFormSchemaServer({
});
}
if (data.members.length > tournament.maxMembersPerTeam) {
if (data.members.length > ADMIN_REGISTRATION_MAX_MEMBERS) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: "forms:errors.regTooManyMembers",

View File

@@ -14,7 +14,12 @@ import {
tournamentSearchOptional,
userSearch,
} from "~/form/fields";
import { TEAM } from "../team/team-constants";
/**
* Roster size cap for organizer-managed registrations. The per-tournament
* `maxMembersPerTeam` limit intentionally doesn't apply to organizers, so this
* is just a generous safety ceiling rather than a competitive constraint.
*/
export const ADMIN_REGISTRATION_MAX_MEMBERS = 20;
const memberFieldset = fieldset({
fields: z.object({
@@ -44,7 +49,7 @@ export const adminRegistrationFormSchema = z
members: array({
label: "labels.members",
min: 1,
max: TEAM.MAX_MEMBER_COUNT,
max: ADMIN_REGISTRATION_MAX_MEMBERS,
field: memberFieldset,
}),
})