mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-25 20:03:12 +03:00
Fixed product filtering for available products
no refs
This commit is contained in:
parent
7fe377d29a
commit
4fdcd9c4d0
@ -179,12 +179,14 @@ export function getAvailableProducts({site}) {
|
||||
}
|
||||
|
||||
return products.filter(product => !!product).filter((product) => {
|
||||
return !!(product.monthlyPrice && product.yearlyPrice);
|
||||
}).filter((product) => {
|
||||
if (portalProducts) {
|
||||
return portalProducts.includes(product.id);
|
||||
}
|
||||
return true;
|
||||
}).sort((productA, productB) => {
|
||||
return productA?.monthlyPrice?.amount - productB?.monthlyPrice.amount;
|
||||
return productA?.monthlyPrice?.amount - productB?.monthlyPrice?.amount;
|
||||
}).map((product) => {
|
||||
product.monthlyPrice = {
|
||||
...product.monthlyPrice,
|
||||
|
Loading…
Reference in New Issue
Block a user