From d48cc24810ee981bc92ad4a901ee16e37f8d378a Mon Sep 17 00:00:00 2001 From: Kalle <38327916+Sendouc@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:40:36 +0300 Subject: [PATCH] Fix posting regular calendar events --- app/features/calendar/CalendarRepository.server.ts | 2 +- app/features/calendar/actions/calendar.new.server.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/features/calendar/CalendarRepository.server.ts b/app/features/calendar/CalendarRepository.server.ts index 29c67d725..c10173051 100644 --- a/app/features/calendar/CalendarRepository.server.ts +++ b/app/features/calendar/CalendarRepository.server.ts @@ -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; diff --git a/app/features/calendar/actions/calendar.new.server.ts b/app/features/calendar/actions/calendar.new.server.ts index 1ae71a187..37bd98919 100644 --- a/app/features/calendar/actions/calendar.new.server.ts +++ b/app/features/calendar/actions/calendar.new.server.ts @@ -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,