diff --git a/src/app/create-brand/page.tsx b/src/app/create-brand/page.tsx index 9cb4fd1..77e87e8 100644 --- a/src/app/create-brand/page.tsx +++ b/src/app/create-brand/page.tsx @@ -37,9 +37,13 @@ const API_KEY = process.env.NEXT_PUBLIC_STORAGE_API! const client = new NFTStorage({ token: API_KEY }) const formSchema = z.object({ - name: z.string().min(2, { - message: 'Brand name must be at least 2 characters', - }), + name: z.string() + .min(2, { + message: 'Brand name must be at least 2 characters', + }) + .regex(/^[a-zA-Z\s]*$/, { + message: 'Brand name must only contain letters', + }), 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 769e2db..cbe908c 100644 --- a/src/app/create-collection/page.tsx +++ b/src/app/create-collection/page.tsx @@ -38,13 +38,15 @@ const client = new NFTStorage({ token: API_KEY }) const formSchema = z.object({ name: z.string().min(2, { - message: 'Brand name must be at least 2 characters', + message: 'Collection name must be at least 2 characters', + }).regex(/^[a-zA-Z\s]*$/, { + message: 'Collection name must only contain letters', }), description: z .string() - .min(2, { message: 'Brand description must be at least 2 characters' }) + .min(2, { message: 'Collection description must be at least 2 characters' }) .max(1000, { - message: 'Brand description should be less than 1000 words', + message: 'Collection description should be less than 1000 words', }), logo_image: z.string(), cover_image: z.string(), diff --git a/src/app/create-phygital/page.tsx b/src/app/create-phygital/page.tsx index d0c7cf3..2a5566e 100644 --- a/src/app/create-phygital/page.tsx +++ b/src/app/create-phygital/page.tsx @@ -32,6 +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', }), category: z .array(z.string()), @@ -43,7 +45,7 @@ const formSchema = z.object({ .string() .min(2, { message: 'Description must be at least 2 characters' }) .max(1000, { - message: 'Brand description should be less than 1000 words', + message: 'Phygital description should be less than 1000 words', }), price: z.string().min(1, { message: 'Price must be provided' }), quantity: z.string().min(1, { message: 'Quantity must be provided' }),