@infrab4a/connect 0.7.2 → 0.7.3

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.
@@ -849,7 +849,7 @@
849
849
 
850
850
  exports.Shops = void 0;
851
851
  (function (Shops) {
852
- Shops["MENSMARKET"] = "Men's Market";
852
+ Shops["MENSMARKET"] = "mensmarket";
853
853
  Shops["GLAMSHOP"] = "Glamshop";
854
854
  })(exports.Shops || (exports.Shops = {}));
855
855
 
@@ -1639,7 +1639,7 @@
1639
1639
  };
1640
1640
  CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds) {
1641
1641
  return __awaiter(this, void 0, void 0, function () {
1642
- var categorySnap, categories, homeSections, categories_1, categories_1_1, category, productSnap, products, e_1_1;
1642
+ var categorySnap, categories, homeSections, categories_1, categories_1_1, category, publishedField, productSnap, products, e_1_1;
1643
1643
  var e_1, _a;
1644
1644
  return __generator(this, function (_b) {
1645
1645
  switch (_b.label) {
@@ -1661,8 +1661,10 @@
1661
1661
  case 3:
1662
1662
  if (!!categories_1_1.done) return [3 /*break*/, 6];
1663
1663
  category = categories_1_1.value;
1664
+ publishedField = category.shop === exports.Shops.GLAMSHOP ? 'publishedGlam' : 'published';
1664
1665
  return [4 /*yield*/, this.collection('products')
1665
1666
  .where('categories', 'array-contains', category.id)
1667
+ .where(publishedField, '==', true)
1666
1668
  .where('stock.quantity', '>', 1)
1667
1669
  .limit(4)
1668
1670
  .get()];