diff --git a/server/helper/heytripDataHelper.js b/server/helper/heytripDataHelper.js index 6236a44..d969803 100644 --- a/server/helper/heytripDataHelper.js +++ b/server/helper/heytripDataHelper.js @@ -216,7 +216,7 @@ const scoresMapper = (sourceName, hotelId, scores, lgcObj) => scores.map((item) const resolveDetails = (res, lgcObj) => { return res.reduce( (rd, c) => { - if (isEmpty(c.HotelName) && isEmpty(c.LocaleName)) { + if ((isEmpty(c.HotelName) && isEmpty(c.LocaleName)) || isEmpty(c.Rooms)) { return rd; } rd.info.push(infoDataMapper(c)); diff --git a/server/services/heytripService.js b/server/services/heytripService.js index 31d6d5c..7601228 100644 --- a/server/services/heytripService.js +++ b/server/services/heytripService.js @@ -483,7 +483,7 @@ class Heytrip { }; const _quoteRes = await Availability(paramBody); const quoteRes = resolveRatePlans(_quoteRes); - const roomsQuote = quoteRes.map((row) => ({...row, ...roomMappedByID[row.RoomId]})); + const roomsQuote = quoteRes.map((row) => ({...row, ...(roomMappedByID[row.RoomId] || {})})); this.writeHeytripRequestLog({ action: 'heytripAvailability',