-
Notifications
You must be signed in to change notification settings - Fork 437
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 dispatch with useQuery and request in Asset module #6374
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.
Remove all additional useState's used to store the response data as this is already achieved by useQuery
itself and you can access the data directly instead of again creating another useState
@kshitijv256 https://deploy-preview-6374--care-net.netlify.app/facility/9447524f-6d2b-4b24-87dc-e30f68c6642c/assets/1ce11cbf-2398-4f9b-8828-6d416250bf15 we are having multiple asset with name "test-camera" under the facility test-oct-firstweek. When we create a new asset with the name test-camera, the transaction history details are getting manipulated |
@nihal467 fixed the problem please check. transaction filter was being passed incorrectly in request and all transaction data was shown in all assets |
all the changes requested has been done |
LGTM |
👋 Hi, @kshitijv256, This message is automatically generated by prince-chrismc/label-merge-conflicts-action so don't hesitate to report issues/improvements there. |
@kshitijv256 resolve the merge conflicts |
* 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 <rithvikn2001@gmail.com>
* 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 <rithvikn2001@gmail.com>
@@ -43,18 +42,14 @@ const AssetImportModal = ({ open, onClose, facility }: Props) => { | |||
setSelectedFile(undefined); | |||
onClose && onClose(); | |||
}; | |||
|
|||
useEffect(() => { | |||
setLocationsLoading(true); |
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.
Why was this removed? The loader for when the locations are still being fetched does not work anymore.. setLocationsLoading
WHAT
🤖 Generated by Copilot at 08d6244
The pull request refactors the codebase for managing assets and asset services in the frontend. It replaces the redux actions and states with the custom
request
function and theuseQuery
hook for data fetching and updating. It also adds type annotations and validations for the asset-related API routes usingruntypes
. It improves the code quality, performance, and readability by removing unnecessary imports, variables, and dependencies.Proposed Changes
useDispatch
w.useQuery
/request
: Assets (src/Components/Assets/**
) #6326@coronasafe/care-fe-code-reviewers @coronasafe/code-reviewers