@infrab4a/connect 3.7.0 → 3.7.1-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 +8 -5
- package/bundles/infrab4a-connect.umd.js.map +1 -1
- package/domain/catalog/repositories/category.repository.d.ts +3 -3
- package/domain/shop-settings/models/types/index.d.ts +4 -4
- package/esm2015/domain/catalog/repositories/category.repository.js +1 -1
- package/esm2015/domain/shop-settings/models/types/index.js +5 -5
- 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
|
@@ -2568,7 +2568,7 @@
|
|
|
2568
2568
|
})
|
|
2569
2569
|
.catch(function (error) { return error; });
|
|
2570
2570
|
};
|
|
2571
|
-
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
2571
|
+
CategoryFirestoreRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
2572
2572
|
if (limit === void 0) { limit = 4; }
|
|
2573
2573
|
return __awaiter(this, void 0, void 0, function () {
|
|
2574
2574
|
var categorySnap, categories, homeSections;
|
|
@@ -2592,7 +2592,7 @@
|
|
|
2592
2592
|
_a = {
|
|
2593
2593
|
category: category
|
|
2594
2594
|
};
|
|
2595
|
-
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
2595
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
|
|
2596
2596
|
case 1: return [2 /*return*/, (_a.products = _b.sent(),
|
|
2597
2597
|
_a)];
|
|
2598
2598
|
}
|
|
@@ -2633,6 +2633,8 @@
|
|
|
2633
2633
|
query = _b.sent();
|
|
2634
2634
|
if (options === null || options === void 0 ? void 0 : options.hasStock)
|
|
2635
2635
|
query = query.where('stock.quantity', '>', 0);
|
|
2636
|
+
if (options === null || options === void 0 ? void 0 : options.gender)
|
|
2637
|
+
query = query.where('tags', 'array-contains', options === null || options === void 0 ? void 0 : options.gender);
|
|
2636
2638
|
if (options === null || options === void 0 ? void 0 : options.limit)
|
|
2637
2639
|
query = query.limit(options === null || options === void 0 ? void 0 : options.limit);
|
|
2638
2640
|
return [4 /*yield*/, query.get()];
|
|
@@ -3995,7 +3997,7 @@
|
|
|
3995
3997
|
});
|
|
3996
3998
|
});
|
|
3997
3999
|
};
|
|
3998
|
-
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit) {
|
|
4000
|
+
CategoryHasuraGraphQLRepository.prototype.getCategoriesForHome = function (categoryIds, limit, gender) {
|
|
3999
4001
|
if (limit === void 0) { limit = 4; }
|
|
4000
4002
|
return __awaiter(this, void 0, void 0, function () {
|
|
4001
4003
|
var categoriesFirestore, categoriesHasura, categories, _c, _d, _e, _f, _g, _h, _j, _k, homeSections;
|
|
@@ -4046,7 +4048,7 @@
|
|
|
4046
4048
|
_c = {
|
|
4047
4049
|
category: category
|
|
4048
4050
|
};
|
|
4049
|
-
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true })];
|
|
4051
|
+
return [4 /*yield*/, this.mountCategory(category, { limit: limit, hasStock: true, gender: gender })];
|
|
4050
4052
|
case 1: return [2 /*return*/, (_c.products = _d.sent(),
|
|
4051
4053
|
_c)];
|
|
4052
4054
|
}
|
|
@@ -4069,7 +4071,7 @@
|
|
|
4069
4071
|
if (!((_a = category === null || category === void 0 ? void 0 : category.products) === null || _a === void 0 ? void 0 : _a.length))
|
|
4070
4072
|
return [2 /*return*/, []];
|
|
4071
4073
|
products = [];
|
|
4072
|
-
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: [
|
|
4074
|
+
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: [
|
|
4073
4075
|
'id',
|
|
4074
4076
|
'name',
|
|
4075
4077
|
'slug',
|
|
@@ -4093,6 +4095,7 @@
|
|
|
4093
4095
|
'tags',
|
|
4094
4096
|
'type',
|
|
4095
4097
|
'shoppingCount',
|
|
4098
|
+
'gender',
|
|
4096
4099
|
] }, ((options === null || options === void 0 ? void 0 : options.limit) ? { limits: { limit: options === null || options === void 0 ? void 0 : options.limit } } : {})), { options: { enableCount: false } }))];
|
|
4097
4100
|
case 1:
|
|
4098
4101
|
productsData = (_c.sent()).data;
|