@infrab4a/connect 0.13.2 → 0.13.3-beta.1

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.
@@ -2061,7 +2061,7 @@
2061
2061
  CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
2062
2062
  if (limit === void 0) { limit = 4; }
2063
2063
  return __awaiter(this, void 0, void 0, function () {
2064
- var categorySnap, categories, homeSections, categories_1, categories_1_1, category, publishedField, productSnap, products, e_1_1;
2064
+ var categorySnap, categories, homeSections, categories_1, categories_1_1, category, products, e_1_1;
2065
2065
  var e_1, _a;
2066
2066
  return __generator(this, function (_b) {
2067
2067
  switch (_b.label) {
@@ -2083,17 +2083,10 @@
2083
2083
  case 3:
2084
2084
  if (!!categories_1_1.done) return [3 /*break*/, 6];
2085
2085
  category = categories_1_1.value;
2086
- publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
2087
- return [4 /*yield*/, this.collection('products')
2088
- .where('categories', 'array-contains', category.id)
2089
- .where(publishedField, '==', true)
2090
- .where('stock.quantity', '>', 1)
2091
- .limit(limit)
2092
- .get()];
2086
+ return [4 /*yield*/, this.mountCategory(category)];
2093
2087
  case 4:
2094
- productSnap = _b.sent();
2095
- products = productSnap.docs.map(function (doc) { return doc.data(); });
2096
- homeSections.push({ category: category, products: products });
2088
+ products = _b.sent();
2089
+ homeSections.push({ category: category, products: products.splice(0, limit) });
2097
2090
  _b.label = 5;
2098
2091
  case 5:
2099
2092
  categories_1_1 = categories_1.next();