fixed the update inventory in verify medicines page
What does this MR do and why?
This MR fixes the issue where the medicine status was not updating immediately after clicking "Update Inventory".
Previously:
- After updating inventory, the status remained "Pending".
- The updated status (e.g., "Given") was visible only after manually clicking the Refresh button or reloading the page.
Now:
- After successful inventory update, the UI immediately reflects the updated status.
- The existing Refresh button continues to call the same GET API to fetch latest data.
- No functionality or UI layout was changed.
- Only minimal logic was added to refresh state after successful update. This improves user experience and ensures real-time UI consistency.
References
- Fixes delayed UI update after inventory change
- Related to Verify Medicines page (
/volunteer/verify-medicines)
Screenshots or screen recordings
| Before | After |
|
|
|
| Status remained "Pending" after clicking Update Inventory | Status updates immediately to "Given" without manual refresh |
(Optional: Attach screenshots here)
How to set up and validate locally
- Pull the latest changes from this branch.
- Run the frontend application: npm install npm run dev
- Navigate to: 4. Select a medicine with status "Pending".
- Click "Update Inventory".
- Verify that:
- Status changes immediately (e.g., to "Given").
- No page reload is required.
- Refresh button still works correctly.
- No other functionality is affected.
MR acceptance checklist
-
No existing functionality changed -
No API routes modified -
UI layout unchanged -
State updates correctly after inventory update -
Refresh button continues to work -
Code is clean and minimal -
No console errors -
Tested locally
Edited by Vandana reddy Balannagari