♻️ Add email pattern and refactor in frontend (#1138)

This commit is contained in:
Alejandra
2024-03-28 19:49:02 -05:00
committed by GitHub
parent c8e57bb760
commit 84bc7e2ca8
7 changed files with 14 additions and 25 deletions

View File

@@ -25,6 +25,7 @@ import {
UsersService,
} from "../../client"
import useCustomToast from "../../hooks/useCustomToast"
import { emailPattern } from "../../utils"
interface EditUserProps {
user: UserOut
@@ -101,10 +102,7 @@ const EditUser: React.FC<EditUserProps> = ({ user, isOpen, onClose }) => {
id="email"
{...register("email", {
required: "Email is required",
pattern: {
value: /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i,
message: "Invalid email address",
},
pattern: emailPattern,
})}
placeholder="Email"
type="email"