@infrab4a/connect-angular 4.3.13 → 4.3.14
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/adapters/new-category-structure.adapter.mjs +6 -4
- package/esm2020/services/catalog/catalog.service.mjs +8 -4
- package/fesm2015/infrab4a-connect-angular.mjs +10 -7
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +12 -6
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1558,9 +1558,11 @@ class NewCategoryStructureAdapter {
|
|
|
1558
1558
|
.then((categories) => categories.map((category) => category.id.toString()));
|
|
1559
1559
|
}
|
|
1560
1560
|
async getCategory(category) {
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1561
|
+
const collectionCategory = category.isCollection ||
|
|
1562
|
+
(isNil(category.isCollection) && !category.products?.length) ||
|
|
1563
|
+
category.isWishlist ||
|
|
1564
|
+
category.brandCategory;
|
|
1565
|
+
return collectionCategory ? this.categoryRepository.get({ id: category.id }) : category;
|
|
1564
1566
|
}
|
|
1565
1567
|
}
|
|
1566
1568
|
NewCategoryStructureAdapter.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: NewCategoryStructureAdapter, deps: [{ token: 'CategoryRepository' }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
@@ -1680,9 +1682,13 @@ class CatalogService {
|
|
|
1680
1682
|
return this.findCatalogAndSortByMostRevelant(productsIds, options, limits);
|
|
1681
1683
|
}
|
|
1682
1684
|
if (this.hasCategory(options) && options.sort === 'most-relevant') {
|
|
1683
|
-
const productsIds =
|
|
1684
|
-
|
|
1685
|
-
:
|
|
1685
|
+
const productsIds = await this.productRepository
|
|
1686
|
+
.find({
|
|
1687
|
+
filters: {
|
|
1688
|
+
...(await this.buildMainFilter(options)),
|
|
1689
|
+
},
|
|
1690
|
+
})
|
|
1691
|
+
.then((products) => products.data.map((product) => product.id));
|
|
1686
1692
|
return this.findCatalogAndSortByMostRevelant(productsIds, options, limits);
|
|
1687
1693
|
}
|
|
1688
1694
|
const repoParams = {
|