Skip to content

Commit

Permalink
fix: simplify email type
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Dec 2, 2024
1 parent 1df038c commit 7364999
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions studio/schemas/objects/sections/contact-box.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,17 +68,7 @@ export const contactBox = defineField({
defineField({
name: "email",
title: "Enter the email address for contact point",
type: "string",
validation: (rule) =>
rule.custom((value: string | undefined) => {
if (!value) {
return "Must have a valid email address";
}
if (value && !/^\S+@\S+\.\S+$/.test(value)) {
return "Must be a valid email address";
}
return true;
}),
type: "email",
}),
],
preview: {
Expand Down

0 comments on commit 7364999

Please sign in to comment.