@infrab4a/connect 3.14.0-beta.0 → 3.14.0-beta.2

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