14 lines
347 B
TypeScript
14 lines
347 B
TypeScript
import { z } from "zod";
|
|
|
|
export const taskTitleSchema = z
|
|
.string()
|
|
.min(1, "title cannot be empty")
|
|
.max(128, "title cannot be more than 128 characters");
|
|
|
|
export const taskCreationFormSchema = z.object({
|
|
listId: z.number(),
|
|
title: taskTitleSchema, // Text
|
|
});
|
|
|
|
export type TaskCreationSchema = z.infer<typeof taskCreationFormSchema>;
|