Skip to content

Commit

Permalink
fix: added validation for doctor experience input. (#7408)
Browse files Browse the repository at this point in the history
* added validation for doctor experience

* Update src/Components/Users/UserProfile.tsx

suggested changes applied

Co-authored-by: Ashesh <[email protected]>

---------

Co-authored-by: Ashesh <[email protected]>
  • Loading branch information
Spiral-Memory and Ashesh3 authored Mar 19, 2024
1 parent a77ff8b commit b70c853
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 b70c853

Please sign in to comment.