feat(ki-inventory): connect frontend to backend API#5142
Open
abhinav-TB wants to merge 1 commit intodevelopmentfrom
Open
feat(ki-inventory): connect frontend to backend API#5142abhinav-TB wants to merge 1 commit intodevelopmentfrom
abhinav-TB wants to merge 1 commit intodevelopmentfrom
Conversation
✅ Deploy Preview for highestgoodnetwork-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Description
This PR connects the Kitchen and Inventory (KI) dashboard to the live backend API. It establishes the Redux state management layer for inventory items, statistics, and preserved stock, and fixes a critical permission bug in the protected route that was preventing access.
Implements # Kitchen Inventory - API Connectivity
Related PRs (if any):
Backend branch: feature/ki-inventory-api-connect
Main changes explained:
src/actions/KIInventoryActions.js— Implements thunk actions to fetch inventory items, statistics, and preserved stock from the backend.src/reducers/KIInventoryReducer.js— Manages state for inventory data, including loading states and error handling.src/constants/KIInventoryConstants.js— Defines action types for the inventory Redux flow.src/components/KitchenandInventory/KIInventory/KIInventory.jsx— Replaced static mock data with Redux state. AddeduseEffecthooks to trigger data fetching on mount.src/components/common/KitchenandInventory/KIProtectedRoute/KIProtectedRoute.jsx— Commented out an incorrectcanAccessBMPortalpermission check that was incorrectly blocking KI dashboard access.src/reducers/index.js— Integrated thekiInventoryreducer into the root reducer.src/utils/URL.js— Added API constants forKI_INVENTORY_ITEMS,KI_INVENTORY_STATS, andKI_INVENTORY_PRESERVED.How to test:
feature/ki-inventory-api-connectnpm installthennpm start/kitchenandinventory/inventory)Screenshots or videos of changes:
Note: