diff --git a/schema/post.ts b/schema/post.ts index e2415550..30aa730c 100644 --- a/schema/post.ts +++ b/schema/post.ts @@ -26,8 +26,11 @@ export const SavePostSchema = z.object({ tags: z.string().array().max(5).optional(), published: z.string().datetime().optional(), seriesName: z.string() - .trim() - .optional() + .trim() + .min(1, "Series name cannot be empty") + .max(50, "Series name is too long") + .regex(/^[\w\s-]+$/, "Series name can only contain letters, numbers, spaces, and hyphens") + .optional() }); export const PublishPostSchema = z.object({ diff --git a/schema/series.ts b/schema/series.ts deleted file mode 100644 index e457b4cb..00000000 --- a/schema/series.ts +++ /dev/null @@ -1,6 +0,0 @@ -import z from "zod"; - -export const UpdateSeriesSchema = z.object({ - postId: z.string(), - seriesName: z.string().trim().optional() -}); \ No newline at end of file