added character limitation

This commit is contained in:
Pramod Mahajan 2025-04-19 22:11:15 +05:30
parent 37b74270cd
commit ee07d73ee4

View File

@ -41,7 +41,7 @@ const ManageEmployee = () => {
MiddleName: z.string().optional(),
LastName: z.string().min(1, { message: "Last Name is required" }),
Email: z
.string().max(225,"Email cannot exceed 255 characters")
.string().max(80,"Email cannot exceed 80 characters")
.optional()
.refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
message: "Invalid email format",
@ -257,7 +257,7 @@ const ManageEmployee = () => {
</span>
</div>
<div className="card-body">
{!currentEmployee && empLoading && (
{(!currentEmployee && empLoading) && (
<p>Loading Employee Data...</p>
)}
@ -330,7 +330,7 @@ const ManageEmployee = () => {
{...register("Email")}
className="form-control form-control-sm"
placeholder="example@domain.com"
maxLength={255}
maxLength={80}
aria-describedby="Email"
disabled={!!currentEmployee?.email}
/>