backend: Validate maxItems to ensure it is a positive number and capped at 100
This commit is contained in:
parent
427e84de07
commit
cb19aaf77f
@ -99,9 +99,11 @@ const GetParticipantRoleSchema = z.object({
|
||||
const GetRoomFiltersSchema: z.ZodType<MeetRoomFilters> = z.object({
|
||||
maxItems: z.coerce
|
||||
.number()
|
||||
.positive('maxItems must be a positive number')
|
||||
.transform((val) => {
|
||||
// Convert the value to a number
|
||||
const intVal = Math.floor(val);
|
||||
// Ensure it's not greater than 100
|
||||
return intVal > 100 ? 100 : intVal;
|
||||
})
|
||||
.default(10),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user