@infrab4a/connect 3.14.0-beta.0 → 3.14.0-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.
@@ -3340,6 +3340,12 @@
3340
3340
  CategoryFirestoreRepository.prototype.getCategoryByShop = function (shop) {
3341
3341
  return;
3342
3342
  };
3343
+ CategoryFirestoreRepository.prototype.getChildren = function (parentId) {
3344
+ return;
3345
+ };
3346
+ CategoryFirestoreRepository.prototype.isChild = function (id, parentId) {
3347
+ return;
3348
+ };
3343
3349
  return CategoryFirestoreRepository;
3344
3350
  }(withCrudFirestore(withHelpers(withFirestore(Base)))));
3345
3351
 
@@ -5148,6 +5154,38 @@
5148
5154
  });
5149
5155
  });
5150
5156
  };
5157
+ CategoryHasuraGraphQLRepository.prototype.getChildren = function (parentId) {
5158
+ return __awaiter(this, void 0, void 0, function () {
5159
+ var category_tree;
5160
+ return __generator(this, function (_c) {
5161
+ switch (_c.label) {
5162
+ case 0: return [4 /*yield*/, this.query('category_tree', ['id', 'name', 'parent_id'], {
5163
+ args: {
5164
+ type: 'category_tree_args',
5165
+ value: { parentid: parentId },
5166
+ required: true,
5167
+ },
5168
+ })];
5169
+ case 1:
5170
+ category_tree = (_c.sent()).category_tree;
5171
+ return [2 /*return*/, category_tree.map(function (c) { return Category.toInstance(c); })];
5172
+ }
5173
+ });
5174
+ });
5175
+ };
5176
+ CategoryHasuraGraphQLRepository.prototype.isChild = function (id, parentId) {
5177
+ return __awaiter(this, void 0, void 0, function () {
5178
+ var categoryTree;
5179
+ return __generator(this, function (_c) {
5180
+ switch (_c.label) {
5181
+ case 0: return [4 /*yield*/, this.getChildren(parentId)];
5182
+ case 1:
5183
+ categoryTree = _c.sent();
5184
+ return [2 /*return*/, categoryTree.some(function (c) { return c.id == id.toString(); })];
5185
+ }
5186
+ });
5187
+ });
5188
+ };
5151
5189
  return CategoryHasuraGraphQLRepository;
5152
5190
  }(withCrudHasuraGraphQL(withHasuraGraphQL(Base))));
5153
5191