Skip to content

Instantly share code, notes, and snippets.

@biagidp
Last active September 6, 2016 18:57
Show Gist options
  • Save biagidp/c1ab04c46d89dc5b26e50bbc179ffb28 to your computer and use it in GitHub Desktop.
Save biagidp/c1ab04c46d89dc5b26e50bbc179ffb28 to your computer and use it in GitHub Desktop.
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