Updating gender radio button now correctly updates the database value

This commit is contained in:
Sahat Yalkabov
2013-12-06 00:25:49 -05:00
parent ce3a8c78ec
commit 93abd14e28
2 changed files with 5 additions and 4 deletions

View File

@ -14,12 +14,13 @@ exports.getAccount = function(req, res) {
};
exports.postAccountProfile = function(req, res) {
console.log(req.body.gender);
User.findById(req.user.id, function(err, user) {
user.profile.name = req.body.name || '';
user.profile.email = req.body.email || '';
user.profile.gender = req.body.gender || '';
user.profile.location = req.body.location || '';
user.profile.website = req.body.website || '';
user.profile.picture = req.body.picture || '';
user.save(function(err) {
res.redirect('/account');