Skip to content

Commit

Permalink
Improved: added viewIndex for looping in store inventory (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
amansinghbais committed Jun 20, 2024
1 parent 8854566 commit 6b67eaf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/views/PickupLocationModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default defineComponent({
async checkInventory(facilityIds: Array<string>) {
const productIds = this.shipGroup.items.map((item: any) => item.productId)
let isScrollable = true, viewSize = 100, total = 0;
let isScrollable = true, viewSize = 100, viewIndex = 0, total = 0;
let productInventoryResp = [] as any;
try {
Expand All @@ -173,7 +173,8 @@ export default defineComponent({
"facilityId": facilityIds
},
"fieldsToSelect": ["productId", "atp", "facilityName", "facilityId"],
viewSize
viewSize,
viewIndex
});
if(!hasError(resp) && resp.data.count) {
Expand All @@ -184,6 +185,7 @@ export default defineComponent({
productInventoryResp = productInventoryResp.concat(resp.data.docs)
}
if(productInventoryResp >= total) isScrollable = false;
viewIndex++;
}
}
return productInventoryResp.filter((store: any) => store.atp > 0)
Expand Down

0 comments on commit 6b67eaf

Please sign in to comment.