@infrab4a/connect-angular 5.5.0-beta.12 → 5.5.0-beta.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.
@@ -1920,13 +1920,7 @@ class BrandManagerHelper {
1920
1920
  if (isEmpty(brands) && options.filters) {
1921
1921
  delete options.filters.brands;
1922
1922
  }
1923
- if (!this.brandsList[indexKey] && !brands) {
1924
- this.brandsList[indexKey] = await this.fetchBrandsOnly(options);
1925
- }
1926
- else {
1927
- this.brandsList[indexKey] = this.brandsList[indexKey] || brands;
1928
- }
1929
- // this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options))
1923
+ this.brandsList[indexKey] = this.brandsList[indexKey] || brands || (await this.fetchBrandsOnly(options));
1930
1924
  this.brandsList[indexKey] = this.brandsList[indexKey].filter(Boolean);
1931
1925
  if (options.filters) {
1932
1926
  options.filters = {
@@ -1948,10 +1942,15 @@ class BrandManagerHelper {
1948
1942
  return '';
1949
1943
  }
1950
1944
  async fetchBrandsOnly(options) {
1945
+ let filters = {};
1946
+ if (options.category) {
1947
+ filters = await this.productCatalog.categoryStructureAdapter.buildProductFilterByCategory(options.category);
1948
+ }
1951
1949
  return this.productCatalog.productCatalogRepository
1952
1950
  .findCatalog({
1953
1951
  fields: ['id'],
1954
1952
  filters: {
1953
+ ...filters,
1955
1954
  published: { operator: Where.EQUALS, value: true },
1956
1955
  },
1957
1956
  options: {