backend: Update room request validation to require autoDeletionDate to be at least 1 hour in the future

This commit is contained in:
Carlos Santos 2025-04-08 18:50:20 +02:00
parent ef514f752c
commit 0330dcc067

View File

@ -47,7 +47,8 @@ const RoomRequestOptionsSchema: z.ZodType<MeetRoomOptions> = z.object({
autoDeletionDate: z
.number()
.positive('Expiration date must be a positive integer')
.min(Date.now(), 'Expiration date must be in the future'),
.refine((date) => date >= Date.now() + 60 * 60 * 1000, 'Expiration date must be at least 1 hour in the future')
.optional(),
roomIdPrefix: z
.string()
.transform(