Last active
September 6, 2016 18:57
-
-
Save biagidp/c1ab04c46d89dc5b26e50bbc179ffb28 to your computer and use it in GitHub Desktop.
This file contains 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
Logic.FindMatchingUser(User, data.data, function(matchingUser){ | |
if(matchingUser) | |
{ | |
Logs.appendEventLog("Match Found"); | |
console.log("Match Found"); | |
//compare attributes and run update to update | |
User["Id"] = matchingUser.Id; | |
if(Logic.CompareUsers(User, matchingUser) == true) | |
{ | |
console.log("Updating User"); | |
//update user in managed missions | |
connections.UpdateUser(User) | |
} | |
else { | |
Logs.appendEventLog("No Update Needed"); | |
console.log("No Update Needed"); | |
//add User to trip | |
connections.AddUserToTrip(User); | |
} | |
} | |
else { | |
console.log("No match found"); | |
connections.CreateUser(User); | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment