Skip to content

Commit

Permalink
Merge pull request #605 from Travelport-Ukraine/master
Browse files Browse the repository at this point in the history
1.14.4 release
  • Loading branch information
dchertousov authored Nov 29, 2022
2 parents 7c78b49 + 6fbd0c4 commit 80d13d2
Show file tree
Hide file tree
Showing 4 changed files with 85 additions and 48 deletions.
117 changes: 75 additions & 42 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "uapi-json",
"version": "1.14.3",
"version": "1.14.4",
"description": "Travelport Universal API",
"main": "src/",
"files": [
Expand Down Expand Up @@ -51,7 +51,7 @@
"eslint": "^8.3.0",
"eslint-config-airbnb-base": "^13.2.0",
"eslint-plugin-import": "^2.25.3",
"mocha": "^9.2.0",
"mocha": "^10.1.0",
"nyc": "^15.1.0",
"proxyquire": "^2.1.1",
"readline2": "^1.0.1",
Expand Down
8 changes: 4 additions & 4 deletions src/Services/Air/Air.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,10 +273,10 @@ module.exports = (settings) => {
},

async getTickets(options) {
const { pnr } = options;
const ur = await this.getUniversalRecordByPNR({ pnr });
const urData = Array.isArray(ur) ? ur[0] : ur;
const { uapi_reservation_locator: reservationLocatorCode } = urData;
const { pnr, reservationLocator = null } = options;
const reservationLocatorCode = reservationLocator || (
(await this.getBooking({ pnr })).uapi_reservation_locator
);
try {
return await service.getTickets({ reservationLocatorCode });
} catch (err) {
Expand Down
4 changes: 4 additions & 0 deletions src/utils/get-booking-from-ur.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
module.exports = function getBookingFromUr(ur, pnr) {
if (!Array.isArray(ur)) {
return ur;
}

return ur.find(
record => record.pnr === pnr
);
Expand Down

0 comments on commit 80d13d2

Please sign in to comment.