@infrab4a/connect 3.13.5 → 3.13.7

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.
@@ -1518,7 +1518,7 @@
1518
1518
  var instance = _super.toInstance.call(this, data);
1519
1519
  if (!lodash.isNil(data.firstName))
1520
1520
  instance.displayName = "" + data.firstName + (!lodash.isNil(data.lastName) ? " " + data.lastName : '');
1521
- return;
1521
+ return instance;
1522
1522
  };
1523
1523
  User.prototype.toPlain = function () {
1524
1524
  var plain = _super.prototype.toPlain.call(this);
@@ -2543,7 +2543,12 @@
2543
2543
  })];
2544
2544
  case 1:
2545
2545
  search = _a.sent();
2546
- search.hits = search.hits.filter(function (e) { return e._source.name !== ''; });
2546
+ search.hits = search.hits
2547
+ .filter(function (e) { return e._source.name !== ''; })
2548
+ .map(function (hit) {
2549
+ RoundProductPricesHelper.roundProductPrices(hit._source);
2550
+ return hit;
2551
+ });
2547
2552
  return [2 /*return*/, search];
2548
2553
  }
2549
2554
  });
@@ -3336,6 +3341,12 @@
3336
3341
  CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
3337
3342
  return;
3338
3343
  };
3344
+ CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
3345
+ return;
3346
+ };
3347
+ CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
3348
+ return;
3349
+ };
3339
3350
  return CategoryFirestoreRepository;
3340
3351
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
3341
3352
 
@@ -5144,6 +5155,38 @@
5144
5155
  });
5145
5156
  });
5146
5157
  };
5158
+ CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
5159
+ return __awaiter(this, void 0, void 0, function () {
5160
+ var category_tree;
5161
+ return __generator(this, function (_c) {
5162
+ switch (_c.label) {
5163
+ case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
5164
+ args: {
5165
+ type: 'category_tree_args',
5166
+ value: { parentid: parentId },
5167
+ required: true,
5168
+ },
5169
+ })];
5170
+ case 1:
5171
+ category_tree = (_c.sent()).category_tree;
5172
+ return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
5173
+ }
5174
+ });
5175
+ });
5176
+ };
5177
+ CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
5178
+ return __awaiter(this, void 0, void 0, function () {
5179
+ var categoryTree;
5180
+ return __generator(this, function (_c) {
5181
+ switch (_c.label) {
5182
+ case 0: return [4 /*yield*/, this.getChildren(parentId)];
5183
+ case 1:
5184
+ categoryTree = _c.sent();
5185
+ return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
5186
+ }
5187
+ });
5188
+ });
5189
+ };
5147
5190
  return CategoryHasuraGraphQLRepository;
5148
5191
  }(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
5149
5192