@infrab4a/connect-angular 4.5.3-beta.3 → 4.5.3-beta.4
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/esm2020/services/catalog/catalog.service.mjs +5 -1
- package/fesm2015/infrab4a-connect-angular.mjs +4 -0
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +4 -0
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1775,6 +1775,8 @@ class CatalogService {
|
|
|
1775
1775
|
.then((data) => ({ id: { operator: Where.IN, value: data.hits.map(({ _source }) => _source.id) } }));
|
|
1776
1776
|
}
|
|
1777
1777
|
async findCatalogAndSortByMostRevelant(mostRelevants, productIds, options, limits) {
|
|
1778
|
+
console.log('mostRelevant', mostRelevants);
|
|
1779
|
+
console.log('productIds', productIds);
|
|
1778
1780
|
const { offset } = limits;
|
|
1779
1781
|
if (offset === 0) {
|
|
1780
1782
|
limits.limit -= mostRelevants.length;
|
|
@@ -1784,6 +1786,7 @@ class CatalogService {
|
|
|
1784
1786
|
}
|
|
1785
1787
|
console.log('limits', limits);
|
|
1786
1788
|
const mostRelevantProductsIds = [...new Set(...mostRelevants, ...productIds)];
|
|
1789
|
+
console.log('mostRelevantProductsIds', mostRelevantProductsIds);
|
|
1787
1790
|
const totalResult = await this.productRepository.findCatalog({
|
|
1788
1791
|
fields: ['id', 'stock'],
|
|
1789
1792
|
filters: {
|
|
@@ -1796,6 +1799,7 @@ class CatalogService {
|
|
|
1796
1799
|
distinct: ['brand'],
|
|
1797
1800
|
},
|
|
1798
1801
|
}, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1802
|
+
console.log('totalResult', totalResult.count);
|
|
1799
1803
|
const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
|
|
1800
1804
|
const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
|
|
1801
1805
|
const productIdsStock = mostRelevantProductsIds.filter((product) => stockData.some((result) => result.id == product));
|