mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #17821 from overleaf/jel-subscription-populate
[web] Only populate the required admin data for the subscription GitOrigin-RevId: 4c2de85ce9f26b337deeff491b40d74756f21702
This commit is contained in:
parent
94e9456a4b
commit
7e3dfded2d
1 changed files with 2 additions and 4 deletions
|
@ -23,20 +23,18 @@ const SubscriptionLocator = {
|
||||||
},
|
},
|
||||||
|
|
||||||
async getManagedGroupSubscriptions(userOrId) {
|
async getManagedGroupSubscriptions(userOrId) {
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
|
||||||
return await Subscription.find({
|
return await Subscription.find({
|
||||||
manager_ids: userOrId,
|
manager_ids: userOrId,
|
||||||
groupPlan: true,
|
groupPlan: true,
|
||||||
})
|
})
|
||||||
.populate('admin_id')
|
.populate('admin_id', ['_id', 'email'])
|
||||||
.exec()
|
.exec()
|
||||||
},
|
},
|
||||||
|
|
||||||
async getMemberSubscriptions(userOrId) {
|
async getMemberSubscriptions(userOrId) {
|
||||||
const userId = SubscriptionLocator._getUserId(userOrId)
|
const userId = SubscriptionLocator._getUserId(userOrId)
|
||||||
// eslint-disable-next-line no-restricted-syntax
|
|
||||||
return await Subscription.find({ member_ids: userId })
|
return await Subscription.find({ member_ids: userId })
|
||||||
.populate('admin_id')
|
.populate('admin_id', 'email')
|
||||||
.exec()
|
.exec()
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue