ohcnetwork / care_fe

Care is a Digital Public Good enabling TeleICU & Decentralised Administration of Healthcare Capacity across States.
https://care.ohc.network
MIT License
256 stars 449 forks source link

Improve Age Validation in User Creation Form #9001

Open Rishith25 opened 3 weeks ago

Rishith25 commented 3 weeks ago

Description:Currently, when creating a user, if the Date of Birth (DOB) entered corresponds to an age less than 15 years, the system makes an API call and returns an error with the message: "Age must be greater than 15 years."

Image

Proposed Improvement: To enhance the user experience and reduce unnecessary API calls, dynamic client-side validation should be added to the form. This validation would check if the age is at least 15 years before submitting the form, thereby providing immediate feedback to the user.

Expected Behavior:

The form should display an error message dynamically if the user enters a DOB indicating an age less than 15 years. The form should prevent the API call from being made if the age criteria are not met. Benefits:

Reduces API traffic. Improves user experience with real-time feedback.

Rishith25 commented 3 weeks ago

@rithviknishad I would like to work on this can you assign it to me.

rithviknishad commented 3 weeks ago

@Jacobjeevan Could you confirm and assign accordingly if it's being done along with #8878

Jacobjeevan commented 3 weeks ago

@Jacobjeevan Could you confirm and assign accordingly if it's being done along with #8878

@rithviknishad I wasn't planning on editing this page, but since we are using most of the same fields in single user detail/management page, it just makes sense to reuse those components here 🤔

Rishith25 commented 3 weeks ago

@rithviknishad should I proceed with this issue?

rithviknishad commented 3 weeks ago

@Jacobjeevan's PR would be addressing this too @Rishith25

Jacobjeevan commented 3 weeks ago

@abhishekreddy8604 The issue is already assigned and it's taken care of 👍