Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function updateInvite(invite, collaboration, done) {
- var found = _.find(invite.collaborations, function(c) {
- return c.project === collaboration.project
- })
- // There is already an outstanding invite to this user, just push these additional perms onto the collaborations
- // list and send another email. We only push if they have not already been added to the invite.
- if (!found) {
- invite.update({$push:{collaborations: collaboration}}, function(err) {
- if (err) return done(err)
- // Invite updated, should probably send another email to recipient.
- return done(null, false, false)
- });
- } else {
- return done(null, false, true)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement