mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Filtered empty monthly/yearly prices in product
no refs - in a rare scenario when monthly/yearly price comes as empty object, which happens if the price is missing in DB, this adds a guard to ignore the product than cause an error
This commit is contained in:
parent
d8f121e7b0
commit
aabb02fc5f
1 changed files with 2 additions and 0 deletions
|
@ -187,6 +187,8 @@ export function getAvailableProducts({site}) {
|
|||
|
||||
return products.filter(product => !!product).filter((product) => {
|
||||
return !!(product.monthlyPrice && product.yearlyPrice);
|
||||
}).filter((product) => {
|
||||
return !!(Object.keys(product.monthlyPrice).length > 0 && Object.keys(product.yearlyPrice).length > 0);
|
||||
}).filter((product) => {
|
||||
if (portalProducts) {
|
||||
return portalProducts.includes(product.id);
|
||||
|
|
Loading…
Add table
Reference in a new issue