mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-03 16:38:22 +03: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:
parent
4385070881
commit
fbd03525b0
@ -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 {};
|
||||
|
Loading…
Reference in New Issue
Block a user