mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Change first param of getMemberSubscriptions to user_or_id, to match semantics of usage.
This function works whether a user object, or an ObjectId is passed, but the `user_id` param name is confusing.
This commit is contained in:
@@ -14,7 +14,11 @@ module.exports =
|
||||
logger.log user_id:user_id, "got users subscription"
|
||||
callback(err, subscription)
|
||||
|
||||
getMemberSubscriptions: (user_id, callback) ->
|
||||
getMemberSubscriptions: (user_or_id, callback) ->
|
||||
if user_or_id? and user_or_id._id?
|
||||
user_id = user_or_id._id
|
||||
else if user_or_id?
|
||||
user_id = user_or_id
|
||||
logger.log user_id: user_id, "getting users group subscriptions"
|
||||
Subscription.find(member_ids: user_id).populate("admin_id").exec callback
|
||||
|
||||
@@ -25,4 +29,4 @@ module.exports =
|
||||
Subscription.findOne {member_ids: user_id, _id:subscription_id}, {_id:1}, callback
|
||||
|
||||
getGroupSubscriptionMemberOf: (user_id, callback)->
|
||||
Subscription.findOne {member_ids: user_id}, {_id:1, planCode:1}, callback
|
||||
Subscription.findOne {member_ids: user_id}, {_id:1, planCode:1}, callback
|
||||
|
||||
Reference in New Issue
Block a user