fix remove mongoose specific function

This commit is contained in:
Berkeley Martinez
2015-06-24 08:25:34 -07:00
parent 3e24f21828
commit 1f28f877cf

View File

@ -234,14 +234,11 @@ module.exports = function(app) {
return next(err);
}
story = story.pop();
story.rank++;
story.upVotes.push(
{
upVotedBy: req.user.id,
upVotedByUsername: req.user.username
}
);
story.markModified('rank');
story.rank += 1;
story.upVotes.push({
upVotedBy: req.user.id,
upVotedByUsername: req.user.username
});
story.save();
// NOTE(Berks): This logic is full of wholes and race conditions
// this could be the source of many 'can't set headers after