mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-28 01:10:54 +01:00
23 lines
476 B
TypeScript
23 lines
476 B
TypeScript
|
|
import { z } from "zod";
|
||
|
|
|
||
|
|
const paginatedSchema = z.object({
|
||
|
|
search: z.string().optional(),
|
||
|
|
pageSize: z.number().int().positive().default(10),
|
||
|
|
page: z.number().int().positive().default(1),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const byIdSchema = z.object({
|
||
|
|
id: z.string(),
|
||
|
|
});
|
||
|
|
|
||
|
|
const searchSchema = z.object({
|
||
|
|
query: z.string(),
|
||
|
|
limit: z.number().int().positive().default(10),
|
||
|
|
});
|
||
|
|
|
||
|
|
export const commonSchemas = {
|
||
|
|
paginated: paginatedSchema,
|
||
|
|
byId: byIdSchema,
|
||
|
|
search: searchSchema,
|
||
|
|
};
|