@infrab4a/connect-angular 5.2.1-beta.2 → 5.2.1-beta.3

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.
@@ -1723,21 +1723,18 @@ class TermSearchStrategy {
1723
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) =>
1727
- // stockData.some(
1728
- // (result: any) =>
1729
- // result.id === product && (result.gender?.includes(defaultGender) || result.gender?.includes('unisex')),
1730
- // ),
1731
- // )
1726
+ const productIdsStockGender = productIds.filter((product) => stockData.some((result) => result.id === product));
1727
+ // && (result.gender?.includes(defaultGender) || result.gender?.includes('unisex'))
1732
1728
  // const productIdsStockNotGender = productIds.filter((product) =>
1733
- // stockData.some(
1734
- // (result: any) =>
1735
- // result.id === product && !result.gender?.includes(defaultGender) && !result.gender?.includes('unisex'),
1736
- // ),
1729
+ // stockData.some((result: any) => result.id === product),
1737
1730
  // )
1731
+ // && !result.gender?.includes(defaultGender) && !result.gender?.includes('unisex')
1738
1732
  // const productIdsStock = productIdsStockGender.concat(productIdsStockNotGender)
1739
- // const productIdsStockOut = productIds.filter((product) => stockOut.some((result: any) => result.id === product))
1740
- const limitedProductId = stockData.concat(stockOut).slice(limits.offset, limits.offset + limits.limit);
1733
+ const productIdsStock = productIdsStockGender;
1734
+ const productIdsStockOut = productIds.filter((product) => stockOut.some((result) => result.id === product));
1735
+ const limitedProductId = productIdsStock
1736
+ .concat(productIdsStockOut)
1737
+ .slice(limits.offset, limits.offset + limits.limit);
1741
1738
  const orderedId = productIds.filter((product) => limitedProductId.includes(product));
1742
1739
  return this.getDetailedProducts(orderedId, totalResult, fieldsHelper);
1743
1740
  }