@infrab4a/connect 1.0.1-beta.1 → 1.0.2-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.
- package/bundles/infrab4a-connect.umd.js +14 -7
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/esm2015/infra/firebase/firestore/mixins/with-find-firestore.mixin.js +2 -2
- package/esm2015/infra/hasura-graphql/repositories/catalog/product-hasura-graphql.repository.js +3 -1
- package/esm2015/infra/hasura-graphql/repositories/catalog/variant-hasura-graphql.repository.js +6 -3
- package/fesm2015/infrab4a-connect.js +8 -3
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/package.json +1 -1
|
@@ -2002,7 +2002,7 @@
|
|
|
2002
2002
|
if (filtersKeysWithUnordered.length)
|
|
2003
2003
|
filtersKeysWithUnordered.forEach(function (filterKey) {
|
|
2004
2004
|
var _a;
|
|
2005
|
-
return (orderBy = Object.assign((_a = {}, _a[filterKey] = 'asc', _a), orderBy));
|
|
2005
|
+
return (orderBy = Object.assign(Object.assign({}, (![exports.Where.EQUALS].includes(filters[filterKey].operator) ? (_a = {}, _a[filterKey] = 'asc', _a) : {})), orderBy));
|
|
2006
2006
|
});
|
|
2007
2007
|
Object.keys(orderBy).forEach(function (fieldName) { return (query = query.orderBy(fieldName, orderBy[fieldName])); });
|
|
2008
2008
|
}
|
|
@@ -4021,6 +4021,8 @@
|
|
|
4021
4021
|
_e.label = 4;
|
|
4022
4022
|
case 4:
|
|
4023
4023
|
product = _c;
|
|
4024
|
+
if (product.productId)
|
|
4025
|
+
throw new NotFoundError('Product not found, it is a variant');
|
|
4024
4026
|
_d = product;
|
|
4025
4027
|
return [4 /*yield*/, this.findReviewsByProduct(+product.id)];
|
|
4026
4028
|
case 5:
|
|
@@ -4463,7 +4465,7 @@
|
|
|
4463
4465
|
});
|
|
4464
4466
|
var _a;
|
|
4465
4467
|
return __awaiter(this, void 0, void 0, function () {
|
|
4466
|
-
var _c;
|
|
4468
|
+
var variant, _c;
|
|
4467
4469
|
return __generator(this, function (_d) {
|
|
4468
4470
|
switch (_d.label) {
|
|
4469
4471
|
case 0:
|
|
@@ -4471,11 +4473,16 @@
|
|
|
4471
4473
|
return [4 /*yield*/, this.find({ filters: { firestoreId: identifiers.id } })];
|
|
4472
4474
|
case 1:
|
|
4473
4475
|
_c = (_a = (_d.sent()).data) === null || _a === void 0 ? void 0 : _a[0];
|
|
4474
|
-
return [3 /*break*/,
|
|
4475
|
-
case 2:
|
|
4476
|
-
|
|
4477
|
-
|
|
4478
|
-
|
|
4476
|
+
return [3 /*break*/, 4];
|
|
4477
|
+
case 2: return [4 /*yield*/, _super.get.call(this, identifiers)];
|
|
4478
|
+
case 3:
|
|
4479
|
+
_c = _d.sent();
|
|
4480
|
+
_d.label = 4;
|
|
4481
|
+
case 4:
|
|
4482
|
+
variant = _c;
|
|
4483
|
+
if (!variant.productId)
|
|
4484
|
+
throw new NotFoundError("Variant not found, it is a product");
|
|
4485
|
+
return [2 /*return*/, variant];
|
|
4479
4486
|
}
|
|
4480
4487
|
});
|
|
4481
4488
|
});
|