Files
outline/server/routes/api/views/schema.ts
Mohamed ELIDRISSI bef9673530 refactor: add server side validation schema for views (#4953)
* refactor: move files to subfolder

* refactor: schema for views.list

* refactor: schema for views.create
2023-02-28 18:20:27 -08:00

24 lines
636 B
TypeScript

import z from "zod";
import BaseSchema from "../BaseSchema";
export const ViewsListSchema = BaseSchema.extend({
body: z.object({
/** Id of the document to retrieve the views for */
documentId: z.string().uuid(),
/** Whether to include views by suspended users */
includeSuspended: z.boolean().default(false),
}),
});
export type ViewsListReq = z.infer<typeof ViewsListSchema>;
export const ViewsCreateSchema = BaseSchema.extend({
body: z.object({
/** Id of the document to create the view for */
documentId: z.string().uuid(),
}),
});
export type ViewsCreateReq = z.infer<typeof ViewsCreateSchema>;