give points for upvoting, add facebook profile attribute, improve social profile icons

This commit is contained in:
Quincy Larson
2015-05-09 16:23:45 -07:00
parent 70503528d2
commit f3646b0aae
6 changed files with 38 additions and 7 deletions

View File

@@ -235,8 +235,18 @@ exports.upvote = function(req, res, next) {
return next(err);
}
user = user.pop();
user.progressTimestamps.push(Date.now());
user.save();
user.progressTimestamps.push(Date.now() || 0);
user.save(function (err, user) {
req.user.save(function (err, user) {
if (err) {
return next(err);
}
});
req.user.progressTimestamps.push(Date.now() || 0);
if (err) {
return next(err);
}
});
});
return res.send(story);
});

View File

@@ -358,6 +358,7 @@ exports.returnUser = function(req, res, next) {
githubProfile: user.profile.githubProfile,
linkedinProfile: user.profile.linkedinProfile,
codepenProfile: user.profile.codepenProfile,
facebookProfile: user.profile.facebookProfile,
twitterHandle: user.profile.twitterHandle,
bio: user.profile.bio,
picture: user.profile.picture,
@@ -453,6 +454,7 @@ exports.postUpdateProfile = function(req, res, next) {
user.profile.username = req.body.username.trim() || '';
user.profile.location = req.body.location.trim() || '';
user.profile.githubProfile = req.body.githubProfile.trim() || '';
user.profile.facebookProfile = req.body.facebookProfile.trim() || '';
user.profile.linkedinProfile = req.body.linkedinProfile.trim() || '';
user.profile.codepenProfile = req.body.codepenProfile.trim() || '';
user.profile.twitterHandle = req.body.twitterHandle.trim() || '';