Skip to content

Commit

Permalink
Merge pull request #618 from ymaheshwari1/#617
Browse files Browse the repository at this point in the history
Fixed: download count issue when product information is not available from solr(#617)
  • Loading branch information
ymaheshwari1 authored Jan 16, 2025
2 parents c67adfb + 3dcd96b commit 63b7956
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/components/DownloadClosedCountModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,7 @@ async function downloadCSV() {
const downloadData = await Promise.all(cycleCountItems.map(async (item: any) => {
const facility = facilityDetails[item?.facilityId];
const product = getProduct.value(item.productId)
if(product.productId) {
const cycleCountDetails = selectedData.reduce((details: any, property: any) => {
if (property === 'createdDate') {
details[property] = getDateWithOrdinalSuffix(item.createdDate);
Expand All @@ -255,8 +254,8 @@ async function downloadCSV() {
} else if (property === 'facility') {
details[property] = facility[selectedFacilityField.value];
} else if (property === 'primaryProductId') {
details[property] = getProductIdentificationValue(selectedPrimaryProductId.value, product);
} else if (property === 'secondaryProductId') {
details[property] = product.productId ? getProductIdentificationValue(selectedPrimaryProductId.value, product) : item.productId;
} else if (product.productId && property === 'secondaryProductId') {
details[property] = getProductIdentificationValue(selectedSecondaryProductId.value, product);
} else if (property === 'countName' && item.countImportName) {
details[property] = item.countImportName;
Expand All @@ -267,9 +266,8 @@ async function downloadCSV() {
}
return details;
}, {});
return cycleCountDetails;
}
}));
const fileName = `CycleCounts-${DateTime.now().toLocaleString(DateTime.DATETIME_MED_WITH_SECONDS)}.csv`;
Expand Down

0 comments on commit 63b7956

Please sign in to comment.