Skip to content

Commit

Permalink
added validation for doctor experience
Browse files Browse the repository at this point in the history
  • Loading branch information
Spiral-Memory committed Mar 13, 2024
1 parent f39ce83 commit 0e2d8c0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Components/Users/UserProfile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,12 @@ export default function UserProfile() {
errors[field] = "Field is required";
invalidForm = true;
} else if (
states.form.user_type === "Doctor" &&
Number(states.form.doctor_experience_commenced_on) > 100
(states.form.user_type === "Doctor" &&
Number(states.form.doctor_experience_commenced_on) > 100) ||
Number(states.form.doctor_experience_commenced_on) < 0
) {
errors[field] = "Doctor experience should be less than 100 years";
errors[field] =
"Doctor experience should be at least 0 years and less than 100 years.";
invalidForm = true;
}
return;
Expand Down

0 comments on commit 0e2d8c0

Please sign in to comment.