mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated getMember to return plans
no-issue Plans are distinct from subscriptions, as in theory a subscription could have many plans. These moves the construction of the plans array into the getMember function so that every consumer has access to the same data.
This commit is contained in:
parent
b207ea35ec
commit
70343f7923
1 changed files with 3 additions and 1 deletions
|
@ -39,8 +39,10 @@ module.exports = function ({
|
|||
});
|
||||
}));
|
||||
}).then((subscriptions) => {
|
||||
const activeSubscriptions = subscriptions.filter(sub => sub.status === 'active');
|
||||
return Object.assign({}, member, {
|
||||
subscriptions: subscriptions.filter(sub => sub.status === 'active')
|
||||
subscriptions: activeSubscriptions,
|
||||
plans: activeSubscriptions.map(sub => sub.plan)
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue