Created
May 28, 2013 05:10
-
-
Save elbuo8/5660629 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@invite = (email, agencyId, callback) -> | |
(app.get 'users').findOne {email: email}, (error, existingUser) -> | |
if existingUser | |
(app.get 'users').update {_id: existingUser._id}, | |
{$addToSet:{agencies:agencyId}}, (error) -> | |
addToTeam agencyId, existingUser._id, (error) -> | |
console.log 'here' | |
app.EmailHandler.invite email, agencyId, -> | |
callback() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment