Fix posting regular calendar events

This commit is contained in:
Kalle
2024-06-24 15:40:36 +03:00
parent da978ca13e
commit d48cc24810
2 changed files with 3 additions and 3 deletions

View File

@@ -418,7 +418,7 @@ type CreateArgs = Pick<
isFullTournament: boolean;
mapPickingStyle: Tables["Tournament"]["mapPickingStyle"];
bracketProgression: TournamentSettings["bracketProgression"] | null;
minMembersPerTeam: number;
minMembersPerTeam?: number;
teamsPerGroup?: number;
thirdPlaceMatch?: boolean;
autoCheckInAll?: boolean;

View File

@@ -100,7 +100,7 @@ export const action: ActionFunction = async ({ request }) => {
toToolsMode:
rankedModesShort.find((mode) => mode === data.toToolsMode) ?? null,
bracketProgression: formValuesToBracketProgression(data),
minMembersPerTeam: data.minMembersPerTeam,
minMembersPerTeam: data.minMembersPerTeam ?? undefined,
teamsPerGroup: data.teamsPerGroup ?? undefined,
thirdPlaceMatch: data.thirdPlaceMatch ?? undefined,
isRanked: data.isRanked ?? undefined,
@@ -254,7 +254,7 @@ export const newCalendarEventActionSchema = z
// tournament format related fields
//
format: z.enum(FORMATS_SHORT).nullish(),
minMembersPerTeam: z.coerce.number().int().min(1).max(4),
minMembersPerTeam: z.coerce.number().int().min(1).max(4).nullish(),
withUndergroundBracket: z.preprocess(checkboxValueToBoolean, z.boolean()),
thirdPlaceMatch: z.preprocess(
checkboxValueToBoolean,