Update username for stories and comments on username change in profile

This commit is contained in:
Nathan Leniz
2015-03-09 11:59:50 +09:00
parent ca440c53f8
commit 3b3de541b3
2 changed files with 4 additions and 2 deletions

View File

@ -298,7 +298,7 @@ module.exports = {
});
})();
},
updateUserStoryPictures: function(userId, picture) {
updateUserStoryPictures: function(userId, picture, username) {
var counter = 0,
foundStories,
@ -327,12 +327,14 @@ module.exports = {
}
R.forEach(function(comment) {
comment.author.picture = picture;
comment.author.username = username;
comment.markModified('author');
comment.save();
}, foundComments);
R.forEach(function(story) {
story.author.picture = picture;
story.author.username = username;
story.markModified('author');
story.save();
}, foundStories);