Scheduling infrastructure for absolutely everyone.
fix: email validation in user post method API (#12743)
Natnael Yilma0e8ac7e4ed16
diff --git a/apps/api/lib/validations/user.ts b/apps/api/lib/validations/user.tsindex 7c595a33522..98e876c4fe4 100644--- a/apps/api/lib/validations/user.ts+++ b/apps/api/lib/validations/user.ts@@ -92,7 +92,7 @@ export const schemaUserBaseBodyParams = User.pick({// Here we can both require or not (adding optional or nullish) and also rewrite validations for any value// for example making weekStart only accept weekdays as inputconst schemaUserEditParams = z.object({- email: z.string().email(),+ email: z.string().email().toLowerCase(),username: usernameSchema,weekStart: z.nativeEnum(weekdays).optional(),brandColor: z.string().min(4).max(9).regex(/^#/).optional(),@@ -114,7 +114,7 @@ const schemaUserEditParams = z.object({// merging both BaseBodyParams with RequiredParams, and omiting whatever we want at the end.const schemaUserCreateParams = z.object({- email: z.string().email(),+ email: z.string().email().toLowerCase(),username: usernameSchema,weekStart: z.nativeEnum(weekdays).optional(),brandColor: z.string().min(4).max(9).regex(/^#/).optional(),