@infrab4a/connect 3.8.0 → 3.8.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 +8 -5
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/repositories/category.repository.d.ts +3 -3
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/infra/firebase/firestore/repositories/catalog/category-firestore.repository.js +5 -3
- package/esm2015/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.js +5 -4
- package/fesm2015/infrab4a-connect.js +8 -5
- package/fesm2015/infrab4a-connect.js.map +1 -1
- package/infra/firebase/firestore/repositories/catalog/category-firestore.repository.d.ts +2 -1
- package/infra/hasura-graphql/repositories/catalog/category-hasura-graphql.repository.d.ts +2 -1
- package/package.json +1 -1
|
@@ -2598,7 +2598,7 @@
|
|
|
2598
2598
|
})
|
|
2599
2599
|
.catch(function (error) { return error; });
|
|
2600
2600
|
};
|
|
2601
|
-
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
2601
|
+
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
2602
2602
|
if (limit === void 0) { limit = 4; }
|
|
2603
2603
|
return __awaiter(this, void 0, void 0, function () {
|
|
2604
2604
|
var categorySnap, categories, homeSections;
|
|
@@ -2622,7 +2622,7 @@
|
|
|
2622
2622
|
_a = {
|
|
2623
2623
|
category: category
|
|
2624
2624
|
};
|
|
2625
|
-
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
2625
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
|
|
2626
2626
|
case 1: return [2 /*return*/, (_a.products = _b.sent(),
|
|
2627
2627
|
_a)];
|
|
2628
2628
|
}
|
|
@@ -2663,6 +2663,8 @@
|
|
|
2663
2663
|
query = _b.sent();
|
|
2664
2664
|
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
2665
2665
|
query = query.where('stock.quantity', '>', 0);
|
|
2666
|
+
if (options === null || options === void 0 ? void 0 : options.gender)
|
|
2667
|
+
query = query.where('tags', 'array-contains', options === null || options === void 0 ? void 0 : options.gender);
|
|
2666
2668
|
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
2667
2669
|
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
2668
2670
|
return [4 /*yield*/, query.get()];
|
|
@@ -4049,7 +4051,7 @@
|
|
|
4049
4051
|
});
|
|
4050
4052
|
});
|
|
4051
4053
|
};
|
|
4052
|
-
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
4054
|
+
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
4053
4055
|
if (limit === void 0) { limit = 4; }
|
|
4054
4056
|
return __awaiter(this, void 0, void 0, function () {
|
|
4055
4057
|
var categoriesFirestore, categoriesHasura, categories, _c, _d, _e, _f, _g, _h, _j, _k, homeSections;
|
|
@@ -4100,7 +4102,7 @@
|
|
|
4100
4102
|
_c = {
|
|
4101
4103
|
category: category
|
|
4102
4104
|
};
|
|
4103
|
-
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
4105
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
|
|
4104
4106
|
case 1: return [2 /*return*/, (_c.products = _d.sent(),
|
|
4105
4107
|
_c)];
|
|
4106
4108
|
}
|
|
@@ -4123,7 +4125,7 @@
|
|
|
4123
4125
|
if (!((_a = category === null || category === void 0 ? void 0 : category.products) === null || _a === void 0 ? void 0 : _a.length))
|
|
4124
4126
|
return [2 /*return*/, []];
|
|
4125
4127
|
products = [];
|
|
4126
|
-
return [4 /*yield*/, this.productRepository.find(Object.assign(Object.assign({ filters: Object.assign({ id: { operator: exports.Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})), fields: [
|
|
4128
|
+
return [4 /*yield*/, this.productRepository.find(Object.assign(Object.assign({ filters: Object.assign(Object.assign({ id: { operator: exports.Where.IN, value: category.products }, published: true }, ((options === null || options === void 0 ? void 0 : options.hasStock) ? { stock: { quantity: { operator: exports.Where.GT, value: 0 } } } : {})), ((options === null || options === void 0 ? void 0 : options.gender) ? { tags: { operator: exports.Where.IN, value: [options === null || options === void 0 ? void 0 : options.gender] } } : {})), fields: [
|
|
4127
4129
|
'id',
|
|
4128
4130
|
'name',
|
|
4129
4131
|
'slug',
|
|
@@ -4147,6 +4149,7 @@
|
|
|
4147
4149
|
'tags',
|
|
4148
4150
|
'type',
|
|
4149
4151
|
'shoppingCount',
|
|
4152
|
+
'gender',
|
|
4150
4153
|
] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})), { options: { enableCount: false } }))];
|
|
4151
4154
|
case 1:
|
|
4152
4155
|
productsData = (_c.sent()).data;
|