0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00

Filtered active prices in portal settings

refs https://github.com/TryGhost/Team/issues/665

Portal only needs to work with active prices(not archived), this change filters prices sent to Portal to only include active prices
This commit is contained in:
Rishabh 2021-05-07 19:12:12 +05:30
parent 4385070881
commit fbd03525b0

View file

@ -86,9 +86,12 @@ const getDefaultProductPrices = async function () {
const model = await membersService.api.productRepository.get({id: product.get('id')}, {withRelated: ['stripePrices']}); const model = await membersService.api.productRepository.get({id: product.get('id')}, {withRelated: ['stripePrices']});
const productData = model.toJSON(); const productData = model.toJSON();
const prices = productData.stripePrices || []; const prices = productData.stripePrices || [];
const activePrices = prices.filter((d) => {
return !!d.active;
});
return { return {
product: productData, product: productData,
prices prices: activePrices
}; };
} }
return {}; return {};