From e0eace825b3d97610ec51097c816387efca95e98 Mon Sep 17 00:00:00 2001 From: Suraj Mahto Date: Thu, 31 Oct 2024 00:33:03 +0530 Subject: [PATCH] feat : added condition for name to have only letters and numbers --- src/app/create-brand/page.tsx | 4 ++-- src/app/create-collection/page.tsx | 4 ++-- src/app/create-phygital/page.tsx | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/app/create-brand/page.tsx b/src/app/create-brand/page.tsx index 77e87e8..43b1f48 100644 --- a/src/app/create-brand/page.tsx +++ b/src/app/create-brand/page.tsx @@ -41,8 +41,8 @@ const formSchema = z.object({ .min(2, { message: 'Brand name must be at least 2 characters', }) - .regex(/^[a-zA-Z\s]*$/, { - message: 'Brand name must only contain letters', + .regex(/^[a-zA-Z0-9\s]*$/, { + message: 'Brand name must only contain letters and numbers', }), slogan: z.string().min(2, { message: 'Slogan name must be at least 2 characters', diff --git a/src/app/create-collection/page.tsx b/src/app/create-collection/page.tsx index cbe908c..15625a7 100644 --- a/src/app/create-collection/page.tsx +++ b/src/app/create-collection/page.tsx @@ -39,8 +39,8 @@ const client = new NFTStorage({ token: API_KEY }) const formSchema = z.object({ name: z.string().min(2, { message: 'Collection name must be at least 2 characters', - }).regex(/^[a-zA-Z\s]*$/, { - message: 'Collection name must only contain letters', + }).regex(/^[a-zA-Z0-9\s]*$/, { + message: 'Brand name must only contain letters and numbers', }), description: z .string() diff --git a/src/app/create-phygital/page.tsx b/src/app/create-phygital/page.tsx index 2a5566e..41a6b4a 100644 --- a/src/app/create-phygital/page.tsx +++ b/src/app/create-phygital/page.tsx @@ -32,8 +32,8 @@ const client = new NFTStorage({ token: API_KEY }) const formSchema = z.object({ name: z.string().min(2, { message: 'Phygital name must be at least 2 characters', - }).regex(/^[a-zA-Z\s]*$/, { - message: 'Phygital name must only contain letters', + }).regex(/^[a-zA-Z0-9\s]*$/, { + message: 'Brand name must only contain letters and numbers', }), category: z .array(z.string()),