Guest User

Untitled

a guest
Jun 14th, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. function processRelationship(johnsID, ygrittesID, johnsFirstName, johnsLastName, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, requestType)
  2. {
  3. switch(requestType.toLowerCase())
  4. {
  5. case "sendlove":
  6. console.log();
  7. console.log("Calling send love with UserID " + johnsID);
  8. console.log();
  9. console.log("Ygritte's Name from processRelationship = " + ygrittesFirstName + " " + ygrittesLastName);
  10. sendLove(johnsID, johnsFirstName, johnsLastName, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber);
  11. break;
  12. case "scheduledate":
  13. scheduleDate(johnsID);
  14. break;
  15.  
  16. case "getstarted":
  17. console.log("Scarting Scar.");
  18.  
  19. //Wolfboy and Tigerboy: over here we need to detect the ID of the user who pressed Get Scarted. Then we check that user's presence in Mongo - and if the user is not present at all, we add them - otherwise we do nothing.
  20. //Now we check Mongo.
  21. checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, johnsFirstName, johnsLastName, ygrittesPhoneNumber, "getstarted"); //dateArr is insignificant for this scenario, so we pass a null.
  22.  
  23. break;
  24.  
  25. case "accepted": //Wolfboy and Tigerboy - made changes on 6/8/2018.
  26. //Wolfboy and Tigerboy: same scenario as in "getstarted", we check for the user & insert inside this function.
  27. checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, "accepted");
  28. break;
  29. case "declined": //Wolfboy and Tigerboy - made changes on 6/8/2018.
  30. //Wolfboy and Tigerboy: same scenario as in "getstarted", we check for the user & insert inside this function.
  31. checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, "declined");
  32. break;
  33. default:
  34. console.log("Unknown request type.");
  35. break;
  36. }
  37. console.log('message sent!');
  38. }
Add Comment
Please, Sign In to add comment