Skip to content

Scheduling infrastructure for absolutely everyone.

Makes user create/update body strict

zomarsae9c33ddbe0d
diff --git a/lib/validations/user.ts b/lib/validations/user.ts
index c780dfbed80..1a69eb5c7c5 100644
--- a/lib/validations/user.ts
+++ b/lib/validations/user.ts
@@ -122,8 +122,15 @@ const schemaUserCreateParams = z.object({
// @note: These are the values that are editable via PATCH method on the user Model,
// merging both BaseBodyParams with RequiredParams, and omiting whatever we want at the end.
-export const schemaUserEditBodyParams = schemaUserBaseBodyParams.merge(schemaUserEditParams).omit({});
-export const schemaUserCreateBodyParams = schemaUserBaseBodyParams.merge(schemaUserCreateParams).omit({});
+export const schemaUserEditBodyParams = schemaUserBaseBodyParams
+ .merge(schemaUserEditParams)
+ .omit({})
+ .strict();
+
+export const schemaUserCreateBodyParams = schemaUserBaseBodyParams
+ .merge(schemaUserCreateParams)
+ .omit({})
+ .strict();
// @note: These are the values that are always returned when reading a user
export const schemaUserReadPublic = User.pick({