-
Notifications
You must be signed in to change notification settings - Fork 477
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove phone duplication check on patient update #6359
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
✅ Deploy Preview for care-egov-staging ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Passing run #1321 ↗︎
Details:
This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. |
LGTM |
@Ashesh3 We truly appreciate your efforts. Thank you for taking the time to contribute; this is a very valuable contribution to us 🥇. We always welcome your contribution 🙂, so feel free to contribute to anything anytime, and never lose that spirit of innovation 🙌. |
WHAT
🤖 Generated by Copilot at 1fc93a7
Improved form validation for patient registration. Added support for
async
validation functions in theForm
component and used it to check for duplicate phone numbers in thePatientRegister
component. Removed unnecessarydebounce
logic.Proposed Changes
@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
HOW
🤖 Generated by Copilot at 1fc93a7
Form
component by changingvalidate
prop type to accept a function that returns a promise of errors (link)validate
function and assign it tovalidationResult
variable before omitting empty errors and checking error keys inForm
component (link)debounce
import and require statement fromPatientRegister
component (link, link)validateForm
function to anasync
function and usefor...of
loop instead offorEach
to iterate over form fields inPatientRegister
component (link, link)return
statements withbreak
statements insideswitch
cases to avoid exitingvalidateForm
function prematurely inPatientRegister
component (link, link, link, link, link, link, link)duplicateCheck
function insidephone_number
case and add error message if duplicate phone number is found invalidateForm
function inPatientRegister
component (link)duplicateCheck
function from a debounced function to a regularasync
function that returns a boolean value inPatientRegister
component (link)duplicateCheck
function fromonChange
handler ofPhoneNumberField
component inPatientRegister
component (link)