Skip to content

Commit

Permalink
Improved: added comment for inventory groups fetching logic for bette…
Browse files Browse the repository at this point in the history
…r readability (#169)
  • Loading branch information
amansinghbais committed Jan 19, 2024
1 parent c047579 commit 64784a4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/store/modules/facility/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ const actions: ActionTree<FacilityState, RootState> = {
// As inventory channels are fetched while fetching additional facility info
// But here we already have additional facility info, so just getting and adding inventory groups to current.
const inventoryGroups = rootGetters['util/getInventoryGroups'];
// Creating a key called 'isChecked' for inventory groups already associated with current facility.
inventoryGroups.forEach((group: any) => {
const isChecked = (current.facilityGroupInfo?.some((facilityGroup: any) => facilityGroup?.facilityGroupId === group.facilityGroupId))
group.isChecked = isChecked ? isChecked : false;
Expand Down

0 comments on commit 64784a4

Please sign in to comment.