@infrab4a/connect-angular 3.8.1-beta.0 → 3.8.2

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.
@@ -1000,7 +1000,7 @@
1000
1000
  CartService.prototype.getGifts = function () {
1001
1001
  var _this = this;
1002
1002
  return this.checkoutService.getCheckout().pipe(operators.mergeMap(function (checkout) { return __awaiter(_this, void 0, void 0, function () {
1003
- var notGiftItems, cartTotal, campaigns, elegibleCampaigns, _loop_1, campaigns_1, campaigns_1_1, campaign, campaingnProducts, elegibleCampaigns_1, elegibleCampaigns_1_1, campaign, elegibleProducts, _h, _j, product, productData, e_1_1, e_2_1, gifts;
1003
+ var notGiftItems, cartTotal, campaigns, elegibleCampaigns, _loop_1, campaigns_1, campaigns_1_1, campaign, campaingnProducts, elegibleCampaigns_1, elegibleCampaigns_1_1, campaign, elegibleProducts, _h, _j, product, productData, gift, e_1_1, e_2_1, gifts;
1004
1004
  var e_3, _k, e_2, _l, e_1, _m;
1005
1005
  return __generator(this, function (_o) {
1006
1006
  switch (_o.label) {
@@ -1085,7 +1085,10 @@
1085
1085
  productData = (_o.sent()).data;
1086
1086
  if (!productData.length)
1087
1087
  return [3 /*break*/, 7];
1088
- elegibleProducts.push(productData.shift());
1088
+ gift = productData.shift();
1089
+ if (gift.stock.quantity < 1)
1090
+ return [3 /*break*/, 7];
1091
+ elegibleProducts.push(gift);
1089
1092
  _o.label = 7;
1090
1093
  case 7:
1091
1094
  _j = _h.next();