Filtered selected prices in Portal settings

no refs

Filters active prices in Portal settings to only contain the selected prices by site owner in new monthly/yearly price id settings, ignoring all other prices for now.
This commit is contained in:
Rishabh 2021-05-18 20:26:11 +05:30
parent d9367f5b20
commit 2e8db93ab6

View File

@ -89,9 +89,14 @@ const getDefaultProductPrices = async function () {
const activePrices = prices.filter((d) => { const activePrices = prices.filter((d) => {
return !!d.active; return !!d.active;
}); });
const monthlyPriceId = settingsCache.get('members_monthly_price_id');
const yearlyPriceId = settingsCache.get('members_yearly_price_id');
const filteredPrices = activePrices.filter((d) => {
return [monthlyPriceId, yearlyPriceId].includes(d.id);
});
return { return {
product: productData, product: productData,
prices: activePrices prices: filteredPrices
}; };
} }
return {}; return {};