@infrab4a/connect 3.4.0-beta.13 → 3.4.0-beta.15

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.
@@ -1825,8 +1825,9 @@
1825
1825
  'stock',
1826
1826
  'weight',
1827
1827
  'tags',
1828
+ 'filters',
1828
1829
  'hasVariants',
1829
- 'type'
1830
+ 'type',
1830
1831
  ];
1831
1832
  return [4 /*yield*/, this.adapter.query('products/_search', Object.assign({ _source: fields, query: {
1832
1833
  bool: {
@@ -4410,11 +4411,11 @@
4410
4411
  delete: { get: function () { return _super_1.prototype.delete; } }
4411
4412
  });
4412
4413
  return __awaiter(this, void 0, void 0, function () {
4413
- var options, data, categoryFilters;
4414
+ var data, categoryFilters, options;
4414
4415
  return __generator(this, function (_a) {
4415
4416
  switch (_a.label) {
4416
4417
  case 0:
4417
- options = params.options, data = __rest(params, ["options"]);
4418
+ data = params;
4418
4419
  return [4 /*yield*/, this.categoryFilterRepository
4419
4420
  .find({
4420
4421
  filters: {
@@ -4425,12 +4426,21 @@
4425
4426
  case 1:
4426
4427
  categoryFilters = _a.sent();
4427
4428
  if (categoryFilters.length)
4428
- throw new Error('Erro: o filtro está associado a uma ou mais categoria(s)');
4429
- return [4 /*yield*/, this.deleteOptions(options)];
4429
+ throw new Error('O filtro está associado a uma ou mais categoria(s)');
4430
+ return [4 /*yield*/, this.filterOptionRepository
4431
+ .find({
4432
+ filters: {
4433
+ filterId: +data.id,
4434
+ },
4435
+ })
4436
+ .then(function (data) { return data.data; })];
4430
4437
  case 2:
4438
+ options = _a.sent();
4439
+ return [4 /*yield*/, this.deleteOptions(options)];
4440
+ case 3:
4431
4441
  _a.sent();
4432
4442
  return [4 /*yield*/, _super.delete.call(this, { id: +data.id })];
4433
- case 3:
4443
+ case 4:
4434
4444
  _a.sent();
4435
4445
  return [2 /*return*/];
4436
4446
  }
@@ -4593,6 +4603,7 @@
4593
4603
  'weight',
4594
4604
  'gender',
4595
4605
  { tags: { columnName: 'tags', type: HasuraGraphQLColumnType.Jsonb } },
4606
+ { filters: { columnName: 'filters', type: HasuraGraphQLColumnType.Jsonb } },
4596
4607
  { isKit: { columnName: 'is_kit' } },
4597
4608
  { createdAt: { columnName: 'created_at' } },
4598
4609
  { updatedAt: { columnName: 'updated_at' } },