mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-24 23:48:13 -05:00
Filtered active monthly/yearly prices in portal settings
no refs We only want to show currently active monthly/yearly prices in Portal and Portal settings based on new settings for price ids, and hide all other prices
This commit is contained in:
parent
fcef76cebf
commit
11be983d99
1 changed files with 5 additions and 1 deletions
|
@ -26,10 +26,14 @@ export default ModalComponent.extend({
|
|||
|
||||
confirm() {},
|
||||
|
||||
filteredPrices: computed('prices', 'settings.portalPlans.[]', function () {
|
||||
filteredPrices: computed('prices', 'settings.{portalPlans.[],membersMonthlyPriceId,membersYearlyPriceId}', function () {
|
||||
const monthlyPriceId = this.settings.get('membersMonthlyPriceId');
|
||||
const yearlyPriceId = this.settings.get('membersYearlyPriceId');
|
||||
const portalPlans = this.settings.get('portalPlans');
|
||||
const prices = this.prices || [];
|
||||
return prices.filter((d) => {
|
||||
return [monthlyPriceId, yearlyPriceId].includes(d.id);
|
||||
}).filter((d) => {
|
||||
return d.amount !== 0 && d.type === 'recurring';
|
||||
}).map((price) => {
|
||||
return {
|
||||
|
|
Loading…
Add table
Reference in a new issue