Skip to content

Commit e435942

Browse files
authored
#138 Remove storage ID empty strings from tournament form (#140)
1 parent b78e1ad commit e435942

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/TournamentForm/TournamentForm.schema.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ export const tournamentFormSchema = z.object({
4848
startsAt: z.string(), // Local time 0000-00-00T00:00
4949
endsAt: z.string(), // Local time 0000-00-00T00:00
5050
registrationClosesAt: z.string(),
51-
logoStorageId: z.optional(z.string().transform((val) => val as StorageId)),
52-
bannerStorageId: z.optional(z.string().transform((val) => val as StorageId)),
51+
logoStorageId: z.preprocess((val) => val === '' ? undefined : val, z.string().optional().transform((val) => val as StorageId)),
52+
bannerStorageId: z.preprocess((val) => val === '' ? undefined : val, z.string().optional().transform((val) => val as StorageId)),
5353

5454
// Competitor Config
5555
maxCompetitors: z.coerce.number().min(2, 'Tournaments require at least two competitors.'),

0 commit comments

Comments
 (0)