@infrab4a/connect-angular 4.0.0-beta.37 → 4.0.0-beta.38

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.
@@ -1421,8 +1421,8 @@ class CatalogService {
1421
1421
  };
1422
1422
  if (prices?.min || prices?.max)
1423
1423
  set(filters, prices.subscriberPrice ? 'price.subscriberPrice' : 'price.price', [
1424
- ...(prices.min ? [{ operator: Where.GTE, value: prices.min }] : []),
1425
- ...(prices.max ? [{ operator: Where.LTE, value: prices.max }] : []),
1424
+ ...(prices.min ? [{ operator: Where.GTE, value: Math.round(prices.min) }] : []),
1425
+ ...(prices.max ? [{ operator: Where.LTE, value: Math.ceil(prices.max) }] : []),
1426
1426
  ]);
1427
1427
  if (rate)
1428
1428
  filters.rate = { operator: Where.GTE, value: rate };
@@ -1512,14 +1512,9 @@ class CategoryService {
1512
1512
  .then(({ data }) => data.filter((category) => brands.includes(category.conditions.brand)));
1513
1513
  }
1514
1514
  async fetchFilterOptions(category, filters) {
1515
- const categoryFilters = category.filters && category.filters.length
1516
- ? category.filters
1517
- : await this.categoryFilterRepository
1518
- .find({ filters: { categoryId: +category.id } })
1519
- .then(({ data }) => data.map((categoryFilter) => categoryFilter.filter));
1520
- return filters?.length
1521
- ? categoryFilters.filter((categoryFilter) => !filters || !filters.length || categoryFilter.options.some((option) => filters.includes(option.id)))
1522
- : categoryFilters;
1515
+ return await this.categoryFilterRepository
1516
+ .find({ filters: { categoryId: +category.id } })
1517
+ .then(({ data }) => data.map((categoryFilter) => categoryFilter.filter));
1523
1518
  }
1524
1519
  }
1525
1520
  CategoryService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.0", ngImport: i0, type: CategoryService, deps: [{ token: 'ProductRepository' }, { token: 'CategoryRepository' }, { token: 'CategoryFilterRepository' }, { token: CATEGORY_STRUCTURE }, { token: DEFAULT_SHOP }], target: i0.ɵɵFactoryTarget.Injectable });