@infrab4a/connect-angular 3.4.0-beta.4 → 3.4.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1223,51 +1223,49 @@
1223
1223
  } });
1224
1224
 
1225
1225
  var ShippingService = /** @class */ (function () {
1226
- function ShippingService(http, homeService, apiUrl) {
1226
+ function ShippingService(http,
1227
+ // private homeService: HomeShopService,
1228
+ apiUrl) {
1227
1229
  this.http = http;
1228
- this.homeService = homeService;
1229
1230
  this.apiUrl = apiUrl;
1230
1231
  }
1231
1232
  ShippingService.prototype.getMensShippingMethods = function (zip, weightGrams, totalPrice, personId, shop, subscriptionPlan) {
1232
1233
  var _this = this;
1233
- rxjs.combineLatest([
1234
- this.homeService.getHomeData(),
1235
- this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams)
1236
- ]).pipe(operators.map(function (datas, shippings) { return console.log('combineLatest', datas, shippings); }));
1234
+ // combineLatest([
1235
+ // this.homeService.getHomeData(),
1236
+ // this.http.get(`${this.apiUrl}open/checkshippingcompany?personId=${personId}&postalCode=${zip}&weightGrams=${weightGrams}`)
1237
+ // ]).pipe(
1238
+ // map((datas, shippings) => console.log('combineLatest', datas, shippings))
1239
+ // )
1237
1240
  return this.http.get(this.apiUrl + "open/checkshippingcompany?personId=" + personId + "&postalCode=" + zip + "&weightGrams=" + weightGrams)
1238
1241
  .pipe(operators.map(function (data) { return data.result; }), operators.map(function (shippingMethods) { return __awaiter(_this, void 0, void 0, function () {
1239
1242
  var shippingMethodsResponse, datas;
1240
1243
  return __generator(this, function (_a) {
1241
- switch (_a.label) {
1242
- case 0:
1243
- shippingMethodsResponse = shippingMethods;
1244
- console.log('shippingMethods', shippingMethods);
1245
- if (!shippingMethods.length)
1246
- return [2 /*return*/, []];
1247
- return [4 /*yield*/, this.homeService.getHomeData().toPromise().then(function (data) { return data.sameDayNotAvaliable; })];
1248
- case 1:
1249
- datas = _a.sent();
1250
- if (this.isHolidays(datas)) {
1251
- shippingMethodsResponse = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
1252
- }
1253
- if (totalPrice >= 200 || this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
1254
- return [2 /*return*/, shippingMethodsResponse.map(function (s) {
1255
- if (s.serviceName !== 'Same Day')
1256
- return Object.assign(Object.assign({}, s), { totalPrice: 0 });
1257
- else
1258
- return s;
1259
- })];
1260
- }
1261
- if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
1262
- return [2 /*return*/, shippingMethodsResponse.map(function (s) {
1263
- if (s.serviceName !== 'Same Day')
1264
- return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
1265
- else
1266
- return s;
1267
- })];
1268
- }
1269
- return [2 /*return*/, shippingMethodsResponse];
1244
+ shippingMethodsResponse = shippingMethods;
1245
+ console.log('shippingMethods', shippingMethods);
1246
+ if (!shippingMethods.length)
1247
+ return [2 /*return*/, []];
1248
+ datas = [];
1249
+ if (this.isHolidays(datas)) {
1250
+ shippingMethodsResponse = shippingMethods.filter(function (method) { return method.ShippingCompanyName !== 'Same Day'; });
1251
+ }
1252
+ if (totalPrice >= 200 || this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
1253
+ return [2 /*return*/, shippingMethodsResponse.map(function (s) {
1254
+ if (s.serviceName !== 'Same Day')
1255
+ return Object.assign(Object.assign({}, s), { totalPrice: 0 });
1256
+ else
1257
+ return s;
1258
+ })];
1259
+ }
1260
+ if (this.isFreeShippingBySubscription(shop, subscriptionPlan)) {
1261
+ return [2 /*return*/, shippingMethodsResponse.map(function (s) {
1262
+ if (s.serviceName !== 'Same Day')
1263
+ return Object.assign(Object.assign({}, s), { totalPrice: s.totalPrice / 2 });
1264
+ else
1265
+ return s;
1266
+ })];
1270
1267
  }
1268
+ return [2 /*return*/, shippingMethodsResponse];
1271
1269
  });
1272
1270
  }); }));
1273
1271
  };
@@ -1301,12 +1299,12 @@
1301
1299
  };
1302
1300
  return ShippingService;
1303
1301
  }());
1304
- ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: HomeShopService }, { token: API_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1302
+ ShippingService.ɵfac = i0__namespace.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, deps: [{ token: i1__namespace$3.HttpClient }, { token: API_URL }], target: i0__namespace.ɵɵFactoryTarget.Injectable });
1305
1303
  ShippingService.ɵprov = i0__namespace.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService });
1306
1304
  i0__namespace.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.12", ngImport: i0__namespace, type: ShippingService, decorators: [{
1307
1305
  type: i0.Injectable
1308
1306
  }], ctorParameters: function () {
1309
- return [{ type: i1__namespace$3.HttpClient }, { type: HomeShopService }, { type: undefined, decorators: [{
1307
+ return [{ type: i1__namespace$3.HttpClient }, { type: undefined, decorators: [{
1310
1308
  type: i0.Inject,
1311
1309
  args: [API_URL]
1312
1310
  }] }];