Merge pull request #3385 from akhilmhdh/feat/add-max-role

Added max to $OR in search function
This commit is contained in:
Akhil Mohan
2025-04-09 22:37:36 +05:30
committed by GitHub

View File

@@ -39,5 +39,5 @@ export type TSearchResource = {
};
export const buildSearchZodSchema = <T extends TSearchResource>(schema: z.ZodObject<T>) => {
return schema.extend({ $or: schema.array().optional() }).optional();
return schema.extend({ $or: schema.array().max(5).optional() }).optional();
};