@infrab4a/connect-angular 5.2.1-beta.0 → 5.2.1-beta.2
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.
- package/esm2020/services/catalog/strategies/term-search.strategy.mjs +16 -8
- package/fesm2015/infrab4a-connect-angular.mjs +15 -7
- package/fesm2015/infrab4a-connect-angular.mjs.map +1 -1
- package/fesm2020/infrab4a-connect-angular.mjs +15 -7
- package/fesm2020/infrab4a-connect-angular.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1723,13 +1723,21 @@ 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
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
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
|
+
// )
|
|
1732
|
+
// const productIdsStockNotGender = productIds.filter((product) =>
|
|
1733
|
+
// stockData.some(
|
|
1734
|
+
// (result: any) =>
|
|
1735
|
+
// result.id === product && !result.gender?.includes(defaultGender) && !result.gender?.includes('unisex'),
|
|
1736
|
+
// ),
|
|
1737
|
+
// )
|
|
1738
|
+
// 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
1741
|
const orderedId = productIds.filter((product) => limitedProductId.includes(product));
|
|
1734
1742
|
return this.getDetailedProducts(orderedId, totalResult, fieldsHelper);
|
|
1735
1743
|
}
|