mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 06:09:02 +02:00
Merge pull request #1128 from sharelatex/jel-add-user-to-team-db-op
Change database operator to add user to team GitOrigin-RevId: 0bf23c1f8958f74fa00a97559ebbf03e4edadfa6
This commit is contained in:
committed by
sharelatex
parent
9752aa2fad
commit
a18176b2fa
@@ -33,7 +33,7 @@ module.exports = SubscriptionUpdater =
|
||||
searchOps =
|
||||
_id: subscriptionId
|
||||
insertOperation =
|
||||
{ $push: { member_ids: { $each: memberIds } } }
|
||||
{ $addToSet: { member_ids: { $each: memberIds } } }
|
||||
|
||||
Subscription.findAndModify searchOps, insertOperation, (err, subscription) ->
|
||||
return callback(err) if err?
|
||||
|
||||
@@ -180,7 +180,7 @@ describe "SubscriptionUpdater", ->
|
||||
searchOps =
|
||||
_id: @subscription._id
|
||||
insertOperation =
|
||||
{ $push: { member_ids: { $each: [@otherUserId] } } }
|
||||
{ $addToSet: { member_ids: { $each: [@otherUserId] } } }
|
||||
@findAndModifyStub.calledWith(searchOps, insertOperation).should.equal true
|
||||
done()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user