Remove AADHAR card validation while creating user
This commit is contained in:
parent
bb23d10996
commit
3d62071fb6
@ -41,7 +41,8 @@ const ManageEmployee = () => {
|
|||||||
MiddleName: z.string().optional(),
|
MiddleName: z.string().optional(),
|
||||||
LastName: z.string().min(1, { message: "Last Name is required" }),
|
LastName: z.string().min(1, { message: "Last Name is required" }),
|
||||||
Email: z
|
Email: z
|
||||||
.string().max(80,"Email cannot exceed 80 characters")
|
.string()
|
||||||
|
.max(80, "Email cannot exceed 80 characters")
|
||||||
.optional()
|
.optional()
|
||||||
.refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
|
.refine((val) => !val || /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(val), {
|
||||||
message: "Invalid email format",
|
message: "Invalid email format",
|
||||||
@ -96,8 +97,10 @@ const ManageEmployee = () => {
|
|||||||
}),
|
}),
|
||||||
AadharNumber: z
|
AadharNumber: z
|
||||||
.string()
|
.string()
|
||||||
.regex(/^\d{12}$/, "Aadhar card must be exactly 12 digits long")
|
.optional()
|
||||||
.nonempty("Aadhar card is required"),
|
.refine((val) => !val || /^\d{12}$/.test(val), {
|
||||||
|
message: "Aadhar card must be exactly 12 digits long",
|
||||||
|
}),
|
||||||
Gender: z
|
Gender: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, { message: "Gender is required" })
|
.min(1, { message: "Gender is required" })
|
||||||
@ -154,7 +157,6 @@ const ManageEmployee = () => {
|
|||||||
|
|
||||||
const AadharNumberValue = watch("AadharNumber") || "";
|
const AadharNumberValue = watch("AadharNumber") || "";
|
||||||
|
|
||||||
|
|
||||||
const onSubmit = (data) => {
|
const onSubmit = (data) => {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
|
|
||||||
@ -185,10 +187,10 @@ const ManageEmployee = () => {
|
|||||||
showToast("Employee details updated successfully.", "success");
|
showToast("Employee details updated successfully.", "success");
|
||||||
clearCacheKey("employeeListByProject");
|
clearCacheKey("employeeListByProject");
|
||||||
clearCacheKey("allEmployeeList");
|
clearCacheKey("allEmployeeList");
|
||||||
clearCacheKey("employeeProfile")
|
clearCacheKey("employeeProfile");
|
||||||
|
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
reset()
|
reset();
|
||||||
navigation("/employees");
|
navigation("/employees");
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
@ -257,7 +259,7 @@ const ManageEmployee = () => {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
{(!currentEmployee && empLoading && employeeId ) && (
|
{!currentEmployee && empLoading && employeeId && (
|
||||||
<p>Loading Employee Data...</p>
|
<p>Loading Employee Data...</p>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
@ -454,7 +456,10 @@ const ManageEmployee = () => {
|
|||||||
}}
|
}}
|
||||||
></textarea>
|
></textarea>
|
||||||
<div className="text-end muted">
|
<div className="text-end muted">
|
||||||
<small> {500 - currentAddressLength} characters left</small>
|
<small>
|
||||||
|
{" "}
|
||||||
|
{500 - currentAddressLength} characters left
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
{errors.CurrentAddress && (
|
{errors.CurrentAddress && (
|
||||||
<div
|
<div
|
||||||
@ -484,7 +489,9 @@ const ManageEmployee = () => {
|
|||||||
}}
|
}}
|
||||||
></textarea>
|
></textarea>
|
||||||
<div className="text-end muted">
|
<div className="text-end muted">
|
||||||
<small>{500 - permanentAddressLength} characters left</small>
|
<small>
|
||||||
|
{500 - permanentAddressLength} characters left
|
||||||
|
</small>
|
||||||
</div>
|
</div>
|
||||||
{errors.PermanentAddress && (
|
{errors.PermanentAddress && (
|
||||||
<div
|
<div
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user