mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-03-11 02:12:21 -05:00
Added labels and products to fetched member identity data (#271)
refs https://github.com/TryGhost/Team/issues/581 refs https://github.com/TryGhost/Team/issues/582 Content gating in Ghost is being expanded from basic public/members/free/paid to allowing full NQL queries. To facilitate quick matching of a member to the visibility query we need details of the associated labels and products alongside the basic member data.
This commit is contained in:
parent
ca473fc273
commit
2f7664e1a8
1 changed files with 9 additions and 1 deletions
|
@ -261,7 +261,15 @@ module.exports = function MembersApi({
|
|||
}
|
||||
|
||||
async function getMemberIdentityData(email) {
|
||||
const model = await users.get({email}, {withRelated: ['stripeSubscriptions', 'stripeSubscriptions.customer', 'stripeSubscriptions.stripePrice', 'stripeSubscriptions.stripePrice.stripeProduct', 'stripeSubscriptions.stripePrice.stripeProduct.product']});
|
||||
const model = await users.get({email}, {withRelated: [
|
||||
'stripeSubscriptions',
|
||||
'stripeSubscriptions.customer',
|
||||
'stripeSubscriptions.stripePrice',
|
||||
'stripeSubscriptions.stripePrice.stripeProduct',
|
||||
'stripeSubscriptions.stripePrice.stripeProduct.product',
|
||||
'labels',
|
||||
'products'
|
||||
]});
|
||||
if (!model) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue