Skip to content

Commit

Permalink
feat : added condition for name to have only letters
Browse files Browse the repository at this point in the history
and numbers
  • Loading branch information
surajhub255 committed Oct 30, 2024
1 parent 2e10cda commit e0eace8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/app/create-brand/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
4 changes: 2 additions & 2 deletions src/app/create-collection/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions src/app/create-phygital/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit e0eace8

Please sign in to comment.