-
Notifications
You must be signed in to change notification settings - Fork 516
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
change all useDispatch to useQuery and request hooks in Consultations (src/Components/Facility/Consultations/**) #6416
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. |
… Fix#6372 merge conflict resolved
@rithviknishad can you review it ! |
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.
-
For all GET requests dispatched during component initial render/mount should be using useQuery!
-
If that request is a paginated response API, consider using the PaginatedList component instead as it'll handle most of the cases for you with minimal code. See example: https://github.com/coronasafe/care_fe/blob/develop/src/Components/Facility/LocationManagement.tsx
…page (ohcnetwork#5347) * fix(daily_round): added recommend_discharge as action * fix: rebased the branch
* Middleware override feature in asset location * Fix tooltip clipping * Fix Flaky Cypress test in Facility Module (ohcnetwork#6384) * fix random facility page failure * fix random facility page failure * Revert "Prescriptions: Shrink discontinued prescriptions + Flip MAR timeline + Freeze primary columns in horizontal scroll (ohcnetwork#6282)" (ohcnetwork#6386) This reverts commit 5009a86. * Refactor Asset Model Import Formatting (ohcnetwork#6388) * Refactor Asset Model Import Formatting * fixes to warranty_amc_end_of_validity * Fix asset import file for cypress * Refactor: replaced Dispatch to useQuery/Request of src/Components/Auth/log… (ohcnetwork#6333) * Refactor: replaced useDispatch to useQuery of src/Components/Auth/login.tsx * fix:useQuery changed to Request * feat: replaced dispatch with request * fix: types and added pathparams * fix: request body error * Update Login.tsx * change:Tres to Tbody * fixes: response type change * Update package-lock.json * fix hover height (ohcnetwork#6352) * Split routes of App Router (ohcnetwork#6363) * Prescription: show prescribed on & by and discontinued date in detail card (ohcnetwork#6365) * Fixed bug in location picker in update facility page (ohcnetwork#6377) * add all cases for map rendering * implement location pointer on searched location * Added cam auto reset in asset config page (ohcnetwork#6375) * 💊 Adds support for editing prescriptions + Adds `useSlug` hook (ohcnetwork#6369) * Adds hook: `useSlug` * bug fix: NumericWithUnits field not showing intial value * Form: support for showing global errors * Adds support for editing prescriptions (fixes ohcnetwork#6340) * Fix cypress * fix cypress * Improve design --------- Co-authored-by: Mohammed Nihal <[email protected]> Co-authored-by: Rithvik Nishad <[email protected]> Co-authored-by: Aaron Jevil Nazareth <[email protected]> Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gampa Sri Harsh <[email protected]> Co-authored-by: Tasnimul H. Tauhid <[email protected]>
…/Components/ExternalResult/** ) (ohcnetwork#6402) * replaced dispatch with useQuery in ResultList * replaced useDispatch with useQuery in listfilter * replaced useDispatch with reqeust in ExternalResultUpload * fixed filtering * fix ResultList * rm clg * make code readable * fix build * removed useEffect and useState from ResultList.tsx * Apply changes from code review --------- Co-authored-by: rithviknishad <[email protected]>
👋 Hi, @AshrafMd-1, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
…twork#6428) * added cypress test to verify warranty expiry label * updated spec to check if the warranty expiry label goes off once updated * verify the last change --------- Co-authored-by: Mohammed Nihal <[email protected]>
…rk#6374) * changed to request in HL7monitor.tsx * replaced dispatch in assetTypes * changed dispatch in filteer, import files * changed all dispatch requests with useQuery and request in asset module * added TBody to various endpoints * fixed assetfilter page * fixed asset import modal page * made requested changes * made requested changes * reverted to assetBedModel * fixed delete asset function * fixed after delete redirection * removed extra setstates * updated failing cypress tests for asset module * removed useEffects * removed changes from cypress files * fixed merge issues * fixed transactions issue * remove console logs ---------- Co-authored-by: Rithvik Nishad <[email protected]>
Optimize lodash. Fixes ohcnetwork#6006
* 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]>
…of 15 mins) (ohcnetwork#6466) * fix JWT token refresh fallback interval * remove jwt_token_refresh_interval from `config.json`
…k#6435) * fix(daily_round): aligned consciousness scale to mews * fix(daily_round): removed optional description * fix NeurologicalTables * fix line break --------- Co-authored-by: rithviknishad <[email protected]>
…ispatch in ConfigureFacility (ohcnetwork#6470)
* Username search cypress test * import error
* fix session expiry detection * Fix logout bug
* Added test for importing and configuring an asset * Revert few changes * nits * Migrated to POM approach * Migrated patient_crud to POM approach * reverted some chnages * FIx * Merge conflicts * Fixed test * Added test for patient_test * nits * add responsiveness to virtual nursing assistant card (ohcnetwork#6130) * allow use stock as well (ohcnetwork#6115) * fixed responsive issue of 'Update Log' button in patient consultation page (ohcnetwork#6113) * fix multiple bed bug (ohcnetwork#6111) * Fixed typo in Date format in Asset management (ohcnetwork#6105) * Added padding to count block on patients page * fixed date format in asset manage page * show only items with no min value (ohcnetwork#6103) * check for id in response (ohcnetwork#6100) * Added Responsiveness to File upload (ohcnetwork#6096) * add responsiveness * refactor * remove overlap (ohcnetwork#6094) * fixed failing test * Fix * Fixed comments * fix comments * Fixed all comments * Migrated test to new test suite * Added upload file test * fixed failing test * Fix failing test * Revert unwanted changes * fixed conflict * random failure fixed * temporary fixed medicine selection --------- Co-authored-by: Pranshu Aggarwal <[email protected]> Co-authored-by: Gokulram A <[email protected]> Co-authored-by: Kshitij Verma <[email protected]> Co-authored-by: Mohammed Nihal <[email protected]>
Hi, This pr has been automatically marked as stale because it has not had any recent activity. It will be automatically closed if no further activity occurs for 7 more days. Thank you for your contributions. |
# Conflicts: # src/Redux/api.tsx
Somehow this pull request literally also added cypress and other files so I will close this and add a new pr request |
WHAT
🤖 Generated by Copilot at aaab0f5
The pull request refactors the code for the facility consultations component and its subcomponents, using a custom
request
function and aroutes
object for making API calls, and simplifying the use of React hooks and state management. It also adds type annotations for some API routes and removes unused code and imports. This improves the code readability, consistency, and type safety.Proposed Changes
useDispatch
w.useQuery
/request
: Consultations (src/Components/Facility/Consultations/**
) #6372@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers
Merge Checklist
HOW
🤖 Generated by Copilot at aaab0f5
request
function and theroutes
object instead of thedispatch
andfireRequest
functions, and to replace theuseCallback
anduseAbortableEffect
hooks withuseEffect
hooks. This involved changing the imports, the function definitions, the API calls, and the error handling in several files. (link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link, link)models.tsx
andapi.tsx
files, and used them in theroutes
object and therequest
function. This improved the type safety and readability of the code. (link, link, link, link, link, link, link, link, link, link, link, link, link, link)