@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.
@@ -1558,9 +1558,11 @@ class NewCategoryStructureAdapter {
1558
1558
  .then((categories) => categories.map((category) => category.id.toString()));
1559
1559
  }
1560
1560
  async getCategory(category) {
1561
- return isNil(category.isCollection) || (category.isCollection && !category.products?.length)
1562
- ? this.categoryRepository.get({ id: category.id })
1563
- : category;
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 = options.category.products?.length
1684
- ? options.category.products
1685
- : await this.categoryRepository.get({ id: options.category.id }).then((categoryFound) => categoryFound.products);
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 = {