Skip to content
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

Replace useDispatch with useQuery and request in PatientRegistration form. #7216

Merged
merged 11 commits into from
Feb 28, 2024

Conversation

sriharsh05
Copy link
Contributor

Proposed Changes

@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers

Merge Checklist

  • Add specs that demonstrate bug / test a new feature.
  • Update product documentation.
  • Ensure that UI text is kept in I18n files.
  • Prep screenshot or demo video for changelog entry, and attach it to issue.
  • Request for Peer Reviews
  • Completion of QA

@sriharsh05 sriharsh05 requested a review from a team as a code owner February 15, 2024 02:31
Copy link

vercel bot commented Feb 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
care-storybook ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 27, 2024 4:18am

Copy link

netlify bot commented Feb 15, 2024

Deploy Preview for care-egov-staging ready!

Name Link
🔨 Latest commit 1348fc5
🔍 Latest deploy log https://app.netlify.com/sites/care-egov-staging/deploys/65dd62506f7f240008b5b09c
😎 Deploy Preview https://deploy-preview-7216--care-egov-staging.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sriharsh05
Copy link
Contributor Author

Hey @rithviknishad ,

In the useQuery block of the getPatient API call, the patient details are not being assigned to the form. I have console logged the data, which is fetched at line no: 448. The data logs properly, but it is not being dispatched at line no: 449.

Can you please point out what mistake I made?

Copy link
Member

@rithviknishad rithviknishad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Although the reducer state is being updated, the field from the <Form> is not being updated. <Form> already has a reducer to handle form state and errors. And in the Patient Register page we are keeping another reducer to handle form state and errors for the same purpose on top of that. This leads to not having a single source of truth.

Either use <Form> alone by removing the custom reducer and rely on it's asyncDefaults prop to pre-fill the form during edit form, or remove the usage of <Form> and rely on the custom defined reducer alone.

src/Components/Patient/PatientRegister.tsx Outdated Show resolved Hide resolved
src/Components/Patient/PatientRegister.tsx Outdated Show resolved Hide resolved
@github-actions github-actions bot added the merge conflict pull requests with merge conflict label Feb 21, 2024
Copy link

👋 Hi, @sriharsh05,
Conflicts have been detected against the base branch. Please rebase your branch against the base branch.


This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there.

@sriharsh05
Copy link
Contributor Author

@rithviknishad
Please review the changes.

@rithviknishad rithviknishad added changes required and removed merge conflict pull requests with merge conflict labels Feb 22, 2024
@sriharsh05
Copy link
Contributor Author

@rithviknishad
Please review the code.

@rithviknishad rithviknishad added reviewed reviewed by a core member and removed needs review labels Feb 23, 2024
@nihal467
Copy link
Member

LGTM

@khavinshankar khavinshankar merged commit 9a53d70 into ohcnetwork:develop Feb 28, 2024
34 of 36 checks passed
Copy link

@sriharsh05 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 🙌.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
reviewed reviewed by a core member tested
Projects
None yet
5 participants