Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
everyone.now.declineInvitation = function(email){
console.log('declineInvitation...');
var emailFrom = getEmailByClient(this.user.clientId);
var groupName = 'group-' + email;
//remove the group reference from the user group list
removeGroupFromUser(email,groupName);
//remove the group
now.removeGroup(groupName);
//notify group creator
callUserFunction(email, 'notify', [emailFrom + ' rejected your invitation.','error']);
};
group.now.saveResultBasket(group.now.resultBasket,function(isSaved) {
//remove the group relation from every user when the group is removed
for(var email in users) {
user = getUser(email);
if(user) {
removeGroupFromUser(email,group.groupName);
}
}
//remove the group
now.removeGroup(group.groupName);
});