Add onEmptyFilter

This commit is contained in:
Adria Navarro 2024-10-10 13:20:20 +02:00
parent 7b789e7853
commit 4324d96833
1 changed files with 8 additions and 4 deletions

View File

@ -1,6 +1,7 @@
import { import {
ArrayOperator, ArrayOperator,
BasicOperator, BasicOperator,
EmptyFilterOption,
LogicalOperator, LogicalOperator,
RangeOperator, RangeOperator,
SearchFilterKey, SearchFilterKey,
@ -59,10 +60,13 @@ const queryFilterValidation: Record<SearchFilterKey, z.ZodTypeAny> = {
} }
const searchRowRequest = z.object({ const searchRowRequest = z.object({
query: z.object({ query: z
allOr: z.boolean().optional(), .object({
...queryFilterValidation, allOr: z.boolean().optional(),
}), onEmptyFilter: z.nativeEnum(EmptyFilterOption).optional(),
...queryFilterValidation,
})
.optional(),
paginate: z.boolean().optional(), paginate: z.boolean().optional(),
bookmark: z.union([z.string(), z.number()]).optional(), bookmark: z.union([z.string(), z.number()]).optional(),
limit: z.number().optional(), limit: z.number().optional(),