mts-booking-library 1.2.20 → 1.2.21
Sign up to get free protection for your applications and to get access to all the features.
@@ -341,11 +341,8 @@ var JourneyBooking = /** @class */ (function (_super) {
|
|
341
341
|
if (!linkavelCardNumber && !linkavelCardPhoneNumber) {
|
342
342
|
throw Error("At least one of the parameters linkavelCardNumber and linkavelCardPhoneNumber must be set");
|
343
343
|
}
|
344
|
-
searchParams = new URLSearchParams({
|
345
|
-
|
346
|
-
linkavelCardPhoneNumber: linkavelCardPhoneNumber !== null && linkavelCardPhoneNumber !== void 0 ? linkavelCardPhoneNumber : "",
|
347
|
-
});
|
348
|
-
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams, "}");
|
344
|
+
searchParams = new URLSearchParams(__assign(__assign({}, (linkavelCardNumber && { linkavelCardNumber: linkavelCardNumber })), (linkavelCardPhoneNumber && { linkavelCardPhoneNumber: linkavelCardPhoneNumber })));
|
345
|
+
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams);
|
349
346
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
350
347
|
// Check for errors
|
351
348
|
if ((0, ErrorResponse_1.objectIsMTSErrorResponse)(response)) {
|
@@ -322,11 +322,8 @@ var ServiceBooking = /** @class */ (function (_super) {
|
|
322
322
|
if (!linkavelCardNumber && !linkavelCardPhoneNumber) {
|
323
323
|
throw Error("At least one of the parameters linkavelCardNumber and linkavelCardPhoneNumber must be set");
|
324
324
|
}
|
325
|
-
searchParams = new URLSearchParams({
|
326
|
-
|
327
|
-
linkavelCardPhoneNumber: linkavelCardPhoneNumber !== null && linkavelCardPhoneNumber !== void 0 ? linkavelCardPhoneNumber : "",
|
328
|
-
});
|
329
|
-
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams, "}");
|
325
|
+
searchParams = new URLSearchParams(__assign(__assign({}, (linkavelCardNumber && { linkavelCardNumber: linkavelCardNumber })), (linkavelCardPhoneNumber && { linkavelCardPhoneNumber: linkavelCardPhoneNumber })));
|
326
|
+
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams);
|
330
327
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
331
328
|
// Check for errors
|
332
329
|
if ((0, ErrorResponse_1.objectIsMTSErrorResponse)(response)) {
|
@@ -403,11 +403,8 @@ var SubscriptionBooking = /** @class */ (function (_super) {
|
|
403
403
|
if (!linkavelCardNumber && !linkavelCardPhoneNumber) {
|
404
404
|
throw Error("At least one of the parameters linkavelCardNumber and linkavelCardPhoneNumber must be set");
|
405
405
|
}
|
406
|
-
searchParams = new URLSearchParams({
|
407
|
-
|
408
|
-
linkavelCardPhoneNumber: linkavelCardPhoneNumber !== null && linkavelCardPhoneNumber !== void 0 ? linkavelCardPhoneNumber : "",
|
409
|
-
});
|
410
|
-
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams, "}");
|
406
|
+
searchParams = new URLSearchParams(__assign(__assign({}, (linkavelCardNumber && { linkavelCardNumber: linkavelCardNumber })), (linkavelCardPhoneNumber && { linkavelCardPhoneNumber: linkavelCardPhoneNumber })));
|
407
|
+
url = "".concat(this.config.API_ENDPOINT, "/buyers?").concat(searchParams);
|
411
408
|
return [2 /*return*/, this.callGetApi(url).then(function (response) {
|
412
409
|
// Check for errors
|
413
410
|
if ((0, ErrorResponse_1.objectIsMTSErrorResponse)(response)) {
|