mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Use id to find subscription
It's the new method signature.
This commit is contained in:
parent
ae440f2ee6
commit
66b492ba5f
2 changed files with 3 additions and 2 deletions
|
@ -76,7 +76,7 @@ module.exports = TeamInvitesHandler =
|
|||
return callback(err) if err?
|
||||
return callback(new Errors.NotFoundError('invite not found')) unless invite?
|
||||
|
||||
SubscriptionUpdater.addUserToGroup subscription.admin_id, userId, (err) ->
|
||||
SubscriptionUpdater.addUserToGroup subscription._id, userId, (err) ->
|
||||
return callback(err) if err?
|
||||
|
||||
removeInviteFromTeam(subscription.id, invite.email, callback)
|
||||
|
|
|
@ -26,6 +26,7 @@ describe "TeamInvitesHandler", ->
|
|||
|
||||
@subscription = {
|
||||
id: "55153a8014829a865bbf700d",
|
||||
_id: new ObjectId("55153a8014829a865bbf700d"),
|
||||
admin_id: @manager.id,
|
||||
groupPlan: true,
|
||||
member_ids: [],
|
||||
|
@ -210,7 +211,7 @@ describe "TeamInvitesHandler", ->
|
|||
|
||||
it "adds the user to the team", (done) ->
|
||||
@TeamInvitesHandler.acceptInvite "dddddddd", @user.id, =>
|
||||
@SubscriptionUpdater.addUserToGroup.calledWith(@manager.id, @user.id).should.eq true
|
||||
@SubscriptionUpdater.addUserToGroup.calledWith(@subscription._id, @user.id).should.eq true
|
||||
done()
|
||||
|
||||
it "removes the invite from the subscription", (done) ->
|
||||
|
|
Loading…
Reference in a new issue