-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
refactor(labs): refactor labs module to use react query #2410
refactor(labs): refactor labs module to use react query #2410
Conversation
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/hospitalrun/hospitalrun-frontend/jwbb1xlnz |
@rsousaj there are conflicts to resolve |
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.
need to resolve conflicts
Working on this... Next few hours will be done |
Hi @rsousaj looks like we have a failing test as well. May you take a look at that. |
Sure I'll |
…rontend into issue_2339_labs_module_react_query
Fixes #2339 .
Changes proposed in this pull request:
Added those hooks and respective tests:
-- useLab
-- useLabsSearch
-- useRequestLab
-- useCancelLab
-- useUpdateLab
-- useCompleteLab
Remove lab-slice and labs-slice.
Updated ViewLab, ViewLabs and NewRequestLab tests
Refactor Labs.test
Refactor usePatient parameters to be optional and use useQuery config ({ enabled: id }) to only execute when id is available. This was due to ViewLab needs to execute both useLab and usePatient as dependency and because of that usePatient needs to wait for useLab to execute.
Refactor CareGoalTab.test and CarePlanTab.test to use Route as it's necessary for usePatient return data
Remove lab and labs reducers