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 productData = model.toJSON();
const prices = productData.stripePrices || [];
const activePrices = prices.filter((d) => {
return !!d.active;
});
return {
product: productData,
prices
prices: activePrices
};
}
return {};