improvements: address feedback

This commit is contained in:
Scott Wilson
2025-03-12 17:20:53 -07:00
parent 7415bb93b8
commit 76f34501dc
7 changed files with 23 additions and 9 deletions

View File

@@ -1 +1,13 @@
import { z } from "zod";
export * from "./slugSchema";
export const GenericResourceNameSchema = z
.string()
.trim()
.min(1, { message: "Name must be at least 1 character" })
.max(64, { message: "Name must be 64 or fewer characters" })
.regex(
/^[a-zA-Z0-9\-_\s]+$/,
"Name can only contain alphanumeric characters, dashes, underscores, and spaces"
);