@infrab4a/connect-angular 5.2.1-beta.5 → 5.2.1-beta.7

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.
@@ -1644,7 +1644,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.0", ngImpor
1644
1644
  type: Injectable
1645
1645
  }], ctorParameters: function () { return [{ type: CatalogRepositoryService }, { type: CatalogHelpersService }]; } });
1646
1646
 
1647
- /* eslint-disable no-console */
1648
1647
  class TermSearchStrategy {
1649
1648
  constructor(repositoryService, helpersService) {
1650
1649
  this.repositoryService = repositoryService;
@@ -1722,11 +1721,11 @@ class TermSearchStrategy {
1722
1721
  sortByTermRelevance(params) {
1723
1722
  const { productIds, totalResult, limits, filters, fieldsHelper } = params;
1724
1723
  // const defaultGender = filters?.gender?.at(0) || 'male'
1725
- console.log('productIds', productIds);
1724
+ // console.log('productIds', productIds)
1726
1725
  const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
1727
- console.log('stockData', stockData);
1726
+ // console.log('stockData', stockData)
1728
1727
  const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
1729
- console.log('stockOut', stockOut);
1728
+ // console.log('stockOut', stockOut)
1730
1729
  // const productIdsStockGender = productIds.filter((product) => stockData.some((result: any) => result.id === product))
1731
1730
  // && (result.gender?.includes(defaultGender) || result.gender?.includes('unisex'))
1732
1731
  // const productIdsStockNotGender = productIds.filter((product) =>
@@ -1735,18 +1734,18 @@ class TermSearchStrategy {
1735
1734
  // && !result.gender?.includes(defaultGender) && !result.gender?.includes('unisex')
1736
1735
  // const productIdsStock = productIdsStockGender.concat(productIdsStockNotGender)
1737
1736
  const productIdsStock = productIds.filter((product) => stockData.some((result) => result.id === product));
1738
- console.log('productIdsStock', productIdsStock);
1737
+ // console.log('productIdsStock', productIdsStock)
1739
1738
  const productIdsStockOut = productIds.filter((product) => stockOut.some((result) => result.id === product));
1740
- console.log('productIdsStockOut', productIdsStockOut);
1741
- console.log('concat', productIdsStock.concat(productIdsStockOut));
1739
+ // console.log('productIdsStockOut', productIdsStockOut)
1740
+ // console.log('concat', productIdsStock.concat(productIdsStockOut))
1742
1741
  const limitedProductId = productIdsStock
1743
1742
  .concat(productIdsStockOut)
1744
1743
  .slice(limits.offset, limits.offset + limits.limit);
1745
- console.log('limitedProductId', limitedProductId);
1744
+ // console.log('limitedProductId', limitedProductId)
1746
1745
  // const orderedId = productIds.filter((product) => limitedProductId.includes(product))
1747
- const orderedId = productIds.filter((product) => limitedProductId.some((p) => p === product));
1748
- console.log('orderedId', orderedId);
1749
- return this.getDetailedProducts(orderedId, totalResult, fieldsHelper);
1746
+ // const orderedId = productIds.filter((product) => limitedProductId.some((p) => p === product))
1747
+ // console.log('orderedId', orderedId)
1748
+ return this.getDetailedProducts(limitedProductId, totalResult, fieldsHelper);
1750
1749
  }
1751
1750
  async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
1752
1751
  const productCatalog = this.repositoryService.getProductCatalog();
@@ -1757,7 +1756,10 @@ class TermSearchStrategy {
1757
1756
  },
1758
1757
  fields,
1759
1758
  });
1760
- console.log('detail ordered', orderedId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean));
1759
+ // console.log(
1760
+ // 'detail ordered',
1761
+ // orderedId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
1762
+ // )
1761
1763
  return {
1762
1764
  data: orderedId.map((id) => productResult.data.find((product) => product.id === id)).filter(Boolean),
1763
1765
  count: totalResult.count,