@infrab4a/connect 2.0.13-beta.0 → 2.0.13-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.
@@ -4058,27 +4058,32 @@
4058
4058
  create: { get: function () { return _super_1.prototype.create; } }
4059
4059
  });
4060
4060
  return __awaiter(this, void 0, void 0, function () {
4061
- var product, _c, error_1;
4062
- return __generator(this, function (_d) {
4063
- switch (_d.label) {
4061
+ var product, _c, _d, error_1;
4062
+ return __generator(this, function (_e) {
4063
+ switch (_e.label) {
4064
4064
  case 0: return [4 /*yield*/, _super.create.call(this, lodash.omit(data, ['reviews']))];
4065
4065
  case 1:
4066
- product = _d.sent();
4067
- _d.label = 2;
4066
+ product = _e.sent();
4067
+ _e.label = 2;
4068
4068
  case 2:
4069
- _d.trys.push([2, 4, , 6]);
4069
+ _e.trys.push([2, 5, , 7]);
4070
4070
  _c = product;
4071
+ _d = data.reviews;
4072
+ if (!_d) return [3 /*break*/, 4];
4071
4073
  return [4 /*yield*/, this.updateReviews(+product.id, data)];
4072
4074
  case 3:
4073
- _c.reviews = _d.sent();
4074
- return [3 /*break*/, 6];
4075
+ _d = (_e.sent());
4076
+ _e.label = 4;
4075
4077
  case 4:
4076
- error_1 = _d.sent();
4077
- return [4 /*yield*/, this.delete({ id: product.id })];
4078
+ _c.reviews = _d;
4079
+ return [3 /*break*/, 7];
4078
4080
  case 5:
4079
- _d.sent();
4081
+ error_1 = _e.sent();
4082
+ return [4 /*yield*/, this.delete({ id: product.id })];
4083
+ case 6:
4084
+ _e.sent();
4080
4085
  throw error_1;
4081
- case 6: return [2 /*return*/, product];
4086
+ case 7: return [2 /*return*/, product];
4082
4087
  }
4083
4088
  });
4084
4089
  });