@infrab4a/connect-angular 4.5.3-beta.3 → 4.5.3-beta.5

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.
@@ -1775,6 +1775,8 @@ class CatalogService {
1775
1775
  .then((data) => ({ id: { operator: Where.IN, value: data.hits.map(({ _source }) => _source.id) } }));
1776
1776
  }
1777
1777
  async findCatalogAndSortByMostRevelant(mostRelevants, productIds, options, limits) {
1778
+ console.log('mostRelevant', mostRelevants);
1779
+ console.log('productIds', productIds);
1778
1780
  const { offset } = limits;
1779
1781
  if (offset === 0) {
1780
1782
  limits.limit -= mostRelevants.length;
@@ -1783,7 +1785,8 @@ class CatalogService {
1783
1785
  limits.offset -= mostRelevants.length;
1784
1786
  }
1785
1787
  console.log('limits', limits);
1786
- const mostRelevantProductsIds = [...new Set(...mostRelevants, ...productIds)];
1788
+ const mostRelevantProductsIds = [...new Set(mostRelevants.concat(productIds))];
1789
+ console.log('mostRelevantProductsIds', mostRelevantProductsIds);
1787
1790
  const totalResult = await this.productRepository.findCatalog({
1788
1791
  fields: ['id', 'stock'],
1789
1792
  filters: {
@@ -1796,6 +1799,7 @@ class CatalogService {
1796
1799
  distinct: ['brand'],
1797
1800
  },
1798
1801
  }, options?.mainGender || this.shop === Shops.MENSMARKET ? 'male' : 'female');
1802
+ console.log('totalResult', totalResult.count);
1799
1803
  const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
1800
1804
  const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
1801
1805
  const productIdsStock = mostRelevantProductsIds.filter((product) => stockData.some((result) => result.id == product));