Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. const filteredPrices = drug.map(item => {
  2. const errorCodes = drugPriceErrors;
  3. const pricePath = ['mailPrice.rejectMessage', 'retailPrice.rejectMessage'];
  4.  
  5. _.forEach(pricePath, function (path) {
  6. const rejectMsg = _.get(item, path);
  7. const hasCode = rejectMsg && rejectMsg.find(i => !!~errorCodes.indexOf(+i.settlementCode));
  8. hasCode && delete item[path.split('.').shift()];
  9. });
  10.  
  11. return item;
  12. });
  13.  
  14. TypeError: drug.map is not a function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement