@infrab4a/connect-angular 5.3.0-alpha.0 → 5.3.0-alpha.1

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.
@@ -1720,18 +1720,15 @@ class TermSearchStrategy {
1720
1720
  }
1721
1721
  sortByTermRelevance(params) {
1722
1722
  const { productIds, totalResult, limits, filters, fieldsHelper } = params;
1723
- const defaultGender = filters?.gender?.at(0) || 'male';
1723
+ // const defaultGender = filters?.gender?.at(0) || 'male'
1724
1724
  const stockData = totalResult.data.filter((product) => product.stock.quantity > 0);
1725
1725
  const stockOut = totalResult.data.filter((product) => product.stock.quantity <= 0);
1726
- const productIdsStockGender = productIds.filter((product) => stockData.some((result) => result.id === product && (result.gender?.includes(defaultGender) || result.gender?.includes('unisex'))));
1727
- const productIdsStockNotGender = productIds.filter((product) => stockData.some((result) => result.id === product && !result.gender?.includes(defaultGender) && !result.gender?.includes('unisex')));
1728
- const productIdsStock = productIdsStockGender.concat(productIdsStockNotGender);
1726
+ const productIdsStock = productIds.filter((product) => stockData.some((result) => result.id === product));
1729
1727
  const productIdsStockOut = productIds.filter((product) => stockOut.some((result) => result.id === product));
1730
1728
  const limitedProductId = productIdsStock
1731
1729
  .concat(productIdsStockOut)
1732
1730
  .slice(limits.offset, limits.offset + limits.limit);
1733
- const orderedId = productIds.filter((product) => limitedProductId.includes(product));
1734
- return this.getDetailedProducts(orderedId, totalResult, fieldsHelper);
1731
+ return this.getDetailedProducts(limitedProductId, totalResult, fieldsHelper);
1735
1732
  }
1736
1733
  async getDetailedProducts(orderedId, totalResult, fieldsHelper) {
1737
1734
  const productCatalog = this.repositoryService.getProductCatalog();