16 lines
478 B
TypeScript
16 lines
478 B
TypeScript
|
|
import { z } from 'zod';
|
||
|
|
|
||
|
|
export const baseListQuerySchema = z.object({
|
||
|
|
page: z.coerce.number().int().min(1).default(1),
|
||
|
|
limit: z.coerce.number().int().min(1).max(100).default(25),
|
||
|
|
sort: z.string().optional(),
|
||
|
|
order: z.enum(['asc', 'desc']).default('desc'),
|
||
|
|
search: z.string().optional(),
|
||
|
|
includeArchived: z
|
||
|
|
.enum(['true', 'false'])
|
||
|
|
.transform((v) => v === 'true')
|
||
|
|
.default('false'),
|
||
|
|
});
|
||
|
|
|
||
|
|
export type BaseListQuery = z.infer<typeof baseListQuerySchema>;
|