mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Updated getMemberMetadata to use findAll method
no-issue This means we go via our version of the bookshelf model
This commit is contained in:
parent
ee0449245a
commit
4c07d86086
1 changed files with 6 additions and 6 deletions
|
@ -53,14 +53,14 @@ async function getMemberMetadata(member, module) {
|
|||
return;
|
||||
}
|
||||
|
||||
const customers = (await models.MemberStripeCustomer.where({
|
||||
member_id: member.id
|
||||
}).fetchAll()).toJSON();
|
||||
const customers = (await models.MemberStripeCustomer.findAll({
|
||||
filter: `member_id:${member.id}`
|
||||
})).toJSON();
|
||||
|
||||
const subscriptions = await customers.reduce(async (subscriptionsPromise, customer) => {
|
||||
const customerSubscriptions = await models.StripeCustomerSubscription.where({
|
||||
customer_id: customer.customer_id
|
||||
}).fetchAll();
|
||||
const customerSubscriptions = await models.StripeCustomerSubscription.findAll({
|
||||
filter: `customer_id:${customer.customer_id}`
|
||||
});
|
||||
return (await subscriptionsPromise).concat(customerSubscriptions.toJSON());
|
||||
}, []);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue