Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const filteredPrices = drug.map(item => {
- const errorCodes = drugPriceErrors;
- const pricePath = ['mailPrice.rejectMessage', 'retailPrice.rejectMessage'];
- _.forEach(pricePath, function (path) {
- const rejectMsg = _.get(item, path);
- const hasCode = rejectMsg && rejectMsg.find(i => !!~errorCodes.indexOf(+i.settlementCode));
- hasCode && delete item[path.split('.').shift()];
- });
- return item;
- });
- TypeError: drug.map is not a function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement