@infrab4a/connect-angular 4.1.4-beta.1 → 4.1.4-beta.2
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 -8
- package/fesm2015/infrab4a-connect-angular.mjs +4 -3
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +4 -7
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1541,11 +1541,6 @@ class CatalogService {
|
|
|
1541
1541
|
const limitedProductId = productIds.slice(limits.offset, limits.limit);
|
|
1542
1542
|
const productResult = await this.productRepository.findCatalog({
|
|
1543
1543
|
filters: { id: { operator: Where.IN, value: limitedProductId } },
|
|
1544
|
-
options: {
|
|
1545
|
-
minimal: ['price'],
|
|
1546
|
-
maximum: ['price'],
|
|
1547
|
-
...(!this.hasCategory(options) ? { distinct: ['brand'] } : {}),
|
|
1548
|
-
},
|
|
1549
1544
|
}, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1550
1545
|
const totalResult = await this.productRepository.findCatalog({
|
|
1551
1546
|
fields: ['id'],
|
|
@@ -1558,7 +1553,7 @@ class CatalogService {
|
|
|
1558
1553
|
},
|
|
1559
1554
|
}, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
|
|
1560
1555
|
return {
|
|
1561
|
-
data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)),
|
|
1556
|
+
data: limitedProductId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
|
|
1562
1557
|
count: totalResult.count,
|
|
1563
1558
|
maximum: totalResult.maximum,
|
|
1564
1559
|
minimal: totalResult.minimal,
|
|
@@ -1567,7 +1562,9 @@ class CatalogService {
|
|
|
1567
1562
|
}
|
|
1568
1563
|
async findCatalogIdsByElasticSearch(term) {
|
|
1569
1564
|
return (this.productsByTerm[term] ||
|
|
1570
|
-
this.productIndex
|
|
1565
|
+
this.productIndex
|
|
1566
|
+
.search(term, 999, this.shop)
|
|
1567
|
+
.then((data) => [...new Set(data.hits.map(({ _source }) => _source.id))]));
|
|
1571
1568
|
}
|
|
1572
1569
|
}
|
|
1573
1570
|
CatalogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CatalogService, deps: [{ token: 'ProductRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }, { token: i1$2.ProductsIndex }], target: i0.ɵɵFactoryTarget.Injectable });
|