Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function processRelationship(johnsID, ygrittesID, johnsFirstName, johnsLastName, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, requestType)
- {
- switch(requestType.toLowerCase())
- {
- case "sendlove":
- console.log();
- console.log("Calling send love with UserID " + johnsID);
- console.log();
- console.log("Ygritte's Name from processRelationship = " + ygrittesFirstName + " " + ygrittesLastName);
- sendLove(johnsID, johnsFirstName, johnsLastName, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber);
- break;
- case "scheduledate":
- scheduleDate(johnsID);
- break;
- case "getstarted":
- console.log("Scarting Scar.");
- //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.
- //Now we check Mongo.
- checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, johnsFirstName, johnsLastName, ygrittesPhoneNumber, "getstarted"); //dateArr is insignificant for this scenario, so we pass a null.
- break;
- case "accepted": //Wolfboy and Tigerboy - made changes on 6/8/2018.
- //Wolfboy and Tigerboy: same scenario as in "getstarted", we check for the user & insert inside this function.
- checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, "accepted");
- break;
- case "declined": //Wolfboy and Tigerboy - made changes on 6/8/2018.
- //Wolfboy and Tigerboy: same scenario as in "getstarted", we check for the user & insert inside this function.
- checkForAndInsertSingleUserIntoDB(johnsID, ygrittesID, ygrittesFirstName, ygrittesLastName, ygrittesPhoneNumber, "declined");
- break;
- default:
- console.log("Unknown request type.");
- break;
- }
- console.log('message sent!');
- }
Add Comment
Please, Sign In to add comment