Skip to content

Commit

Permalink
Merge branch 'qa-node20' into production-node20
Browse files Browse the repository at this point in the history
  • Loading branch information
nonword committed Jul 20, 2024
2 parents 68ec380 + 884a9b2 commit 6ae37b1
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/delivery-locations-resolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ class DeliveryLocationsResolver {
const ellapsed = ((new Date()) - __startAll)
logger.debug({ message: `HTC searchByParam API across ${barcodes.length} barcodes took ${ellapsed}ms total`, metric: 'searchByParam-barcode-multiple', timeMs: ellapsed })

// Filter out anything `undefined` and make sure at least one is valid:
const validPairs = [{}].concat(scsbResponses.filter((r) => r))
// Merge array of hashes into one big lookup hash:
return Object.assign.apply(null, validPairs)
// Build barcode-customerCode map:
return barcodes.reduce((h, barcode, ind) => {
if (scsbResponses[ind]) h[barcode] = scsbResponses[ind]
return h
}, {})
})
}

Expand Down

0 comments on commit 6ae37b1

Please sign in to comment.