From 8aa55885e530a71a4c27350c5ba55129cc7ea71e Mon Sep 17 00:00:00 2001 From: Alex Holliday Date: Wed, 20 May 2026 10:28:39 -0700 Subject: [PATCH] add tags validaiton --- client/src/Validation/tag.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 client/src/Validation/tag.ts diff --git a/client/src/Validation/tag.ts b/client/src/Validation/tag.ts new file mode 100644 index 000000000..96d4c6c94 --- /dev/null +++ b/client/src/Validation/tag.ts @@ -0,0 +1,10 @@ +import { z } from "zod"; + +export const tagSchema = z.object({ + name: z.string().min(1, "Please enter a tag name"), + color: z + .string() + .regex(/^#([0-9a-fA-F]{6})$/, "Color must be a 6-digit hex value (e.g. #13715B)"), +}); + +export type TagFormData = z.infer;