@infrab4a/connect 3.2.6-beta.2 → 3.2.6-beta.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.
@@ -3849,20 +3849,23 @@
3849
3849
  case 3:
3850
3850
  _f.apply(_e, [_g.sent()]);
3851
3851
  _g.label = 4;
3852
- case 4: return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
3853
- var _c;
3854
- return __generator(this, function (_d) {
3855
- switch (_d.label) {
3856
- case 0:
3857
- _c = {
3858
- category: category
3859
- };
3860
- return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
3861
- case 1: return [2 /*return*/, (_c.products = _d.sent(),
3862
- _c)];
3863
- }
3864
- });
3865
- }); }))];
3852
+ case 4:
3853
+ if (!categoriesHasura.length)
3854
+ return [2 /*return*/, []];
3855
+ return [4 /*yield*/, Promise.all(categories.map(function (category) { return __awaiter(_this, void 0, void 0, function () {
3856
+ var _c;
3857
+ return __generator(this, function (_d) {
3858
+ switch (_d.label) {
3859
+ case 0:
3860
+ _c = {
3861
+ category: category
3862
+ };
3863
+ return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
3864
+ case 1: return [2 /*return*/, (_c.products = _d.sent(),
3865
+ _c)];
3866
+ }
3867
+ });
3868
+ }); }))];
3866
3869
  case 5:
3867
3870
  homeSections = _g.sent();
3868
3871
  return [2 /*return*/, homeSections];
@@ -3876,6 +3879,8 @@
3876
3879
  return __generator(this, function (_c) {
3877
3880
  switch (_c.label) {
3878
3881
  case 0:
3882
+ if (!(category === null || category === void 0 ? void 0 : category.products))
3883
+ return [2 /*return*/, []];
3879
3884
  products = [];
3880
3885
  return [4 /*yield*/, this.productRepository.find(Object.assign({ filters: Object.assign({ id: { operator: exports.Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})), fields: [
3881
3886
  'id',