@infrab4a/connect-angular 2.0.7 → 2.0.8-beta.0
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.
|
@@ -952,15 +952,27 @@
|
|
|
952
952
|
};
|
|
953
953
|
CartService.prototype.updateUserCart = function (user) {
|
|
954
954
|
var _this = this;
|
|
955
|
-
return this.checkoutService.getCheckout().pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) {
|
|
956
|
-
var _a;
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
955
|
+
return rxjs.from(this.checkoutService.getCheckout()).pipe(operators.concatMap(function (checkout) { return _this.checkoutService.updateCheckoutUser(i2.Checkout.toInstance(Object.assign(Object.assign({}, checkout.toPlain()), { user: user }))); }), operators.concatMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
|
|
956
|
+
var _a, _h, _j, _k, _l, _m, _o, _p, _q;
|
|
957
|
+
var _this = this;
|
|
958
|
+
return __generator(this, function (_r) {
|
|
959
|
+
switch (_r.label) {
|
|
960
|
+
case 0:
|
|
961
|
+
_j = (_h = this.checkoutService).updateCheckoutLineItems;
|
|
962
|
+
_l = (_k = i2.Checkout).toInstance;
|
|
963
|
+
_o = (_m = Object).assign;
|
|
964
|
+
_p = [Object.assign({}, checkout.toPlain())];
|
|
965
|
+
_q = {};
|
|
966
|
+
return [4 /*yield*/, Promise.all((_a = checkout.lineItems) === null || _a === void 0 ? void 0 : _a.map(function (item) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_h) {
|
|
967
|
+
switch (_h.label) {
|
|
968
|
+
case 0: return [4 /*yield*/, this.buildLineItem({ checkout: checkout, item: item })];
|
|
969
|
+
case 1: return [2 /*return*/, (_h.sent()).lineItem];
|
|
970
|
+
}
|
|
971
|
+
}); }); }))];
|
|
972
|
+
case 1: return [2 /*return*/, _j.apply(_h, [_l.apply(_k, [_o.apply(_m, _p.concat([(_q.lineItems = (_r.sent()) || [], _q)]))])]).toPromise()];
|
|
973
|
+
}
|
|
974
|
+
});
|
|
975
|
+
}); }), operators.map(function (checkout) { return _this.generateCartObject(checkout.lineItems); }), operators.tap(function (cart) { return _this.cartSubject.next(cart); }));
|
|
964
976
|
};
|
|
965
977
|
CartService.prototype.clearCart = function () {
|
|
966
978
|
var _this = this;
|