@infrab4a/connect-angular 3.9.4 → 3.9.5

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.
@@ -981,7 +981,7 @@
981
981
  };
982
982
  CartService.prototype.getProductData = function (productId) {
983
983
  return __awaiter(this, void 0, void 0, function () {
984
- var product, variant, error_1;
984
+ var product, variant, error_1, variants;
985
985
  return __generator(this, function (_h) {
986
986
  switch (_h.label) {
987
987
  case 0:
@@ -994,9 +994,12 @@
994
994
  error_1 = _h.sent();
995
995
  if (!(error_1 instanceof i3.NotFoundError))
996
996
  throw error_1;
997
- return [4 /*yield*/, this.variantRepository.get({ id: productId })];
997
+ return [4 /*yield*/, this.variantRepository.find({ filters: { id: productId } })];
998
998
  case 3:
999
- variant = _h.sent();
999
+ variants = (_h.sent()).data;
1000
+ variant = variants.shift();
1001
+ if (!variant)
1002
+ throw error_1;
1000
1003
  return [4 /*yield*/, this.productRepository.get({ id: variant.productId })];
1001
1004
  case 4:
1002
1005
  product = _h.sent();