mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Fixed product filtering for available products
no refs
This commit is contained in:
parent
7fe377d29a
commit
4fdcd9c4d0
1 changed files with 3 additions and 1 deletions
|
@ -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…
Add table
Reference in a new issue