Skip to content
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

Improved: code to pass facilityId filter when fetching items for closed count report(#616) #625

Merged
merged 2 commits into from
Jan 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 2 additions & 13 deletions src/components/DownloadClosedCountModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ async function fetchBulkCycleCountItems() {
let payload = {
statusId: "INV_COUNT_COMPLETED",
pageSize: 200,
facilityId: query.value.facilityIds,
pageIndex: 0
};

Expand All @@ -195,19 +196,7 @@ async function fetchBulkCycleCountItems() {
return [];
}

return query.value.facilityIds.length ? filterItemsByFacility(allItems) : allItems;
}

// Returns items filtered on facility
// TODO: need to add this facility filter in the api itself
function filterItemsByFacility(allItems: any) {
let filteredItems = [] as Array<any>

query.value.facilityIds.map((facilityId: any) => {
filteredItems.push(...allItems.filter((item: any) => item.facilityId === facilityId))
})

return filteredItems;
return allItems;
}

async function fetchProducts(productIds: any){
Expand Down
Loading