@infrab4a/connect-angular 3.2.0 → 3.2.2-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.
@@ -1097,25 +1097,28 @@
1097
1097
  this.homeRepository = homeRepository;
1098
1098
  this.productRepository = productRepository;
1099
1099
  this.defaultShop = defaultShop;
1100
- this.buildCategoryGroupWithRequiredData = function (group) { return ({
1101
- category: i2.Category.toInstance(i2.pick(group.category.toPlain(), ['id', 'name', 'slug', 'conditions'])),
1102
- products: group.products.map(function (product) { return i2.Product.toInstance(i2.pick(product.toPlain(), [
1103
- 'id',
1104
- 'price',
1105
- 'reviews',
1106
- 'hasVariants',
1107
- 'slug',
1108
- 'sku',
1109
- 'stock',
1110
- 'costPrice',
1111
- 'images',
1112
- 'miniatures',
1113
- 'name',
1114
- 'weight',
1115
- 'rate',
1116
- 'type'
1117
- ])); }),
1118
- }); };
1100
+ this.buildCategoryGroupWithRequiredData = function (group) {
1101
+ var _a, _b;
1102
+ return ({
1103
+ category: i2.Category.toInstance(i2.pick(((_a = group === null || group === void 0 ? void 0 : group.category) === null || _a === void 0 ? void 0 : _a.toPlain()) || {}, ['id', 'name', 'slug', 'conditions'])),
1104
+ products: ((_b = group === null || group === void 0 ? void 0 : group.products) === null || _b === void 0 ? void 0 : _b.map(function (product) { return i2.Product.toInstance(i2.pick((product === null || product === void 0 ? void 0 : product.toPlain()) || {}, [
1105
+ 'id',
1106
+ 'price',
1107
+ 'reviews',
1108
+ 'hasVariants',
1109
+ 'slug',
1110
+ 'sku',
1111
+ 'stock',
1112
+ 'costPrice',
1113
+ 'images',
1114
+ 'miniatures',
1115
+ 'name',
1116
+ 'weight',
1117
+ 'rate',
1118
+ 'type',
1119
+ ])); })) || [],
1120
+ });
1121
+ };
1119
1122
  }
1120
1123
  Object.defineProperty(HomeShopService.prototype, "homeId", {
1121
1124
  get: function () {
@@ -1132,8 +1135,8 @@
1132
1135
  var _this = this;
1133
1136
  return this.getHomeConfiguration().pipe(operators.map(function (home) { var _a; return (((_a = home === null || home === void 0 ? void 0 : home.data) === null || _a === void 0 ? void 0 : _a.expiresAt) > new Date() ? home : null); }), operators.concatMap(function (home) { return home
1134
1137
  ? rxjs.of(home)
1135
- : rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_b) {
1136
- var _c = __read(_b, 3), discoverProducts = _c[0], featuredProducts = _c[1], verticalProducts = _c[2];
1138
+ : rxjs.forkJoin([_this.getDiscoverProducts(), _this.getFeaturedProducts(), _this.getVerticalProducts()]).pipe(operators.map(function (_c) {
1139
+ var _d = __read(_c, 3), discoverProducts = _d[0], featuredProducts = _d[1], verticalProducts = _d[2];
1137
1140
  return ({
1138
1141
  discoverProducts: discoverProducts,
1139
1142
  featuredProducts: featuredProducts,
@@ -1169,8 +1172,8 @@
1169
1172
  return this.getHomeConfiguration().pipe(operators.concatMap(function (home) { return rxjs.forkJoin(home.verticalCarousels.filter(Boolean).map(function (id) { return rxjs.from(_this.categoryRepository.get({ id: id })).pipe(operators.concatMap(function (category) { return rxjs.from(_this.productRepository.find({
1170
1173
  filters: { categories: { operator: i2.Where.IN, value: [category.id] } },
1171
1174
  limits: { limit: 12 },
1172
- })).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_b) {
1173
- var category = _b.category, products = _b.products;
1175
+ })).pipe(operators.map(function (products) { return ({ category: category, products: products }); })); }), operators.map(function (_c) {
1176
+ var category = _c.category, products = _c.products;
1174
1177
  return ({ category: category, products: products.data });
1175
1178
  }), operators.map(_this.buildCategoryGroupWithRequiredData)); })); }));
1176
1179
  };