-
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
Replaced useDispatch with useQuery and request. #6344
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, why was package-lock.json changed?
@rithviknishad can you review this pr once
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work on nesting the ABDM related routes under abdm
.
- However, you'll also have to remove the corresponding actions from https://github.com/coronasafe/care_fe/blob/develop/src/Redux/actions.tsx as mentioned in the point 5 of the EPIC issue.
- You'll also have to untrack your
package-lock.json
changes
5a2c77b
to
52fc064
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll also have to add TBody
type definitions for all mutation routes such as (POST PUT PATCH DELETE).
9bc19ed Adds support for it. so you'll have to rebase with the latest develop too in order to do that.
All mutation routes mean only for the Abha routes right? |
yes @shyamprakash123 |
Ready for the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You shouldn't delete package-lock
- rename:
Tbody
toTBody
. - Avoid declaring types in
api.tsx
. Consider declaring them in ABDM's models.ts file itself. Also, you can reuse existing types instead of creating seperate types forTBody
. You can share types by making some unavailable fields to take valueundefined
Eg:
export interface Model {
read_and_write_available_filed: string;
readonly available_only_for_read?: string;
}
f49560a
to
27d2d7e
Compare
Ready for the review. |
Fixed Errors -
CC: @rithviknishad |
@nihal467 I think the errors are fixed, can you recheck this |
in the patient consultation page, once we enter the aadhar number, it is not getting redirected to the otp section |
@nihal467 I just checked the ABHA Link for the patient consultation page it is working as expected. |
LGTM |
👋 Hi, @shyamprakash123, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
* Replaced useDispatch with useQuery and request. * Removed all relevant no longer used actions from actions.tsx * Replaced Res to Type * Added TBody. * used abha in place of JSON.parse(value). * Fixed mobile otp issue * Replaced Rdata with Rerror * Fixed link care context --------- Co-authored-by: Khavin Shankar <[email protected]>
* Replaced useDispatch with useQuery and request. * Removed all relevant no longer used actions from actions.tsx * Replaced Res to Type * Added TBody. * used abha in place of JSON.parse(value). * Fixed mobile otp issue * Replaced Rdata with Rerror * Fixed link care context --------- Co-authored-by: Khavin Shankar <[email protected]>
WHAT
🤖 Generated by Copilot at 741fbac
Refactored ABDM components to use
request
utility and ABDM API routes. Added ABDM API support inapi.tsx
andmodels.ts
.Proposed Changes
useDispatch
w.useQuery
/request
: ABDM (src/Components/ABDM/**
) #6330@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 741fbac
useDispatch
and various ABDM actions from the ABDM components (link, link, link, link, link, link, link)request
,useQuery
, androutes
to the ABDM components to use the custom request and query utilities and the API routes for the ABDM module (link, link, link, link)dispatch
actions with therequest
utility to fetch or update the data from the ABDM API endpoints, and destructure theresponse
anddata
variables from therequest
result (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)data
variable to populate the success data, generate the QR code and the download link, show the notification or error messages, and call the callback functions (link, link, link, link, link, link, link, link, link, link, link, link, link)dispatch
action with theuseQuery
utility to fetch the health facility data, and destructure thehealth_facility
,loading
, andrefetch
variables from theuseQuery
result (link)health_facility
variable to populate the form data, and use therefetch
function to refetch the data on mount or update (link)loading
andisLoading
variables to render the loading component (link)IHealthFacility
,ILinkABHANumber
,IConfirmMobileOtp
,IHealthId
,IAadhaarOtp
,ICheckAndGenerateMobileOtp
, andICreateHealthIdResponse
interfaces to specify the expected response types for the ABDM API endpoints (link)./src/Components/ABDM/models.ts
file (link)abha
property with the ABDM API routes, such asgetAbhaCard
,linkAbhaNumber
,confirmMobileOtp
,createHealthId
,generateAadhaarOtp
,checkAndGenerateMobileOtp
, andverifyAadhaarOtp
(link)TRes
property for each route, which specifies the expected response type for each route, such asIHealthFacility
,ILinkABHANumber
,IConfirmMobileOtp
,IHealthId
,IAadhaarOtp
,ICheckAndGenerateMobileOtp
, andICreateHealthIdResponse
(link)