@infrab4a/connect-angular 3.10.0-beta.2 → 3.10.0-beta.3
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.
|
@@ -958,7 +958,7 @@
|
|
|
958
958
|
};
|
|
959
959
|
CartService.prototype.getProductData = function (productId) {
|
|
960
960
|
return __awaiter(this, void 0, void 0, function () {
|
|
961
|
-
var product, variant, error_1;
|
|
961
|
+
var product, variant, error_1, variants;
|
|
962
962
|
return __generator(this, function (_h) {
|
|
963
963
|
switch (_h.label) {
|
|
964
964
|
case 0:
|
|
@@ -971,9 +971,12 @@
|
|
|
971
971
|
error_1 = _h.sent();
|
|
972
972
|
if (!(error_1 instanceof i3.NotFoundError))
|
|
973
973
|
throw error_1;
|
|
974
|
-
return [4 /*yield*/, this.variantRepository.
|
|
974
|
+
return [4 /*yield*/, this.variantRepository.find({ filters: { id: productId } })];
|
|
975
975
|
case 3:
|
|
976
|
-
|
|
976
|
+
variants = (_h.sent()).data;
|
|
977
|
+
variant = variants.shift();
|
|
978
|
+
if (!variant)
|
|
979
|
+
throw error_1;
|
|
977
980
|
return [4 /*yield*/, this.productRepository.get({ id: variant.productId })];
|
|
978
981
|
case 4:
|
|
979
982
|
product = _h.sent();
|