0
Fork 0
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:
Kevin Ansfield 2021-05-10 11:46:34 +01:00 committed by GitHub
parent ca473fc273
commit 2f7664e1a8

View file

@ -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;
}