-
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 useDipatch with useQuery/request in FacilityCreate and HospitalList files #6591
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. |
@rithviknishad |
👋 Hi, @sriharsh05, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@sriharsh05 the cypress is failing |
I'll look into it @rithviknishad |
@rithviknishad Please review the code. |
@sriharsh05 cypress tests are still failing |
👋 Hi, @sriharsh05, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
👋 Hi, @sriharsh05, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@sriharsh05 can you clear the merge conflict |
@rithviknishad |
|
@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 🙌. |
…talList files (#6591) * Replaced useDipatch with useQuery/request in FacilityCreate and HospitalList files * fix failing api calls * replace function with request calls with useQuery * remove useState variables and used variables from useQuery * fix facility pincode issue * fix longitude and latitude for facility and optimized code * Fixed ward list bug * fix auto fill for pincode bug * remove duplicate request * fix total facility card loading state * fix clear filter badges bug
WHAT
🤖 Generated by Copilot at 1aefc25
Refactored some components in the
Facility
module to use therequest
function and theuseQuery
hook for making and fetching API calls. Added and used some types to ensure type safety and consistency for the data from the backend. Removed some unnecessary code and fixed some minor issues.The pull request partially refactors the codebase for managing facility module in the frontend. It replaces the redux actions and states with the custom request function and the useQuery hook for data fetching and updating. It improves the code quality, performance, and readability by removing unnecessary imports, variables, and dependencies.
This pull request makes the required changes to only 2 files and does not close the entire issue.
Proposed Changes
useDispatch
w.useQuery
/request
: Facility (Part 2, E-H) (src/Components/Facility/[E-H]*.tsx
) #6391@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at 1aefc25
FacilityCreate
component to use therequest
function and theuseQuery
hook for fetching data from the API and removed theuseAbortableEffect
hook and thedispatchAction
function (link, link, link, link, link, link, link, link, link, link, link, link, link)data
variable in theFacilityCreate
component to match the API schema and removed the unnecessary properties (link, link)district
property in thefetchedDistricts
array in theFacilityCreate
component to avoid errors (link)id
variable to a string before setting it as thecreatedFacilityId
state in theFacilityCreate
component (link)FacilityCreate
component as it was handled by therequest
function internally (link)HospitalList
component to use theuseQuery
hook for fetching data from the API and removed theuseAbortableEffect
hook, thedispatchAction
function and thetotalCount
variable (link, link, link, link, link, link, link, link)stateName
,districtName
andlocalbodyName
variables with thestateData
,districtData
andlocalBodyData
variables in theHospitalList
component to display the state, district and local body names from the data returned by theuseQuery
hook (link)IStateListResponse
type to the./models
file to define the type of the response returned by the API for listing the states (link)FacilityModel
,CapacityModal
,DoctorModal
,DistrictModel
,LocalBodyModel
,StateModel
andIStateListResponse
types from./models
to use in theroutes
object in the./api
file (link, link)TRes
property to thecreateFacility
,updateFacility
,getCapacity
,listDoctor
,statesList
,getState
,getDistrict
,getDistrictByState
andgetLocalBody
routes in theroutes
object in the./api
file to define the type of the response returned by the API for each endpoint (link, link, link, link, link, link, link)