Created
June 4, 2012 17:36
-
-
Save mlhamel/2869742 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
req.family.admins.forEach(function(admin) { | |
req.family.admins.remove(admin); | |
}); | |
req.family.members.filter(function(member) { | |
return member.parent; | |
}).forEach(function(member) { | |
req.family.addAdmin(member); | |
}); | |
req.family.save(function(err) { | |
if(err) { | |
return next(new exception.Fatal(err)); | |
} else { | |
return next(req.family); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment