generate paths on retrieval instead of notification creation
also fix follow notification path
This commit is contained in:
barisusakli
2015-02-19 18:14:38 -05:00
parent 82543bdeee
commit 756d03fa62
4 changed files with 37 additions and 29 deletions

View File

@@ -55,11 +55,12 @@ var async = require('async'),
}
if (notification.from && !notification.image) {
User.getUserField(notification.from, 'picture', function(err, picture) {
User.getUserFields(notification.from, ['username', 'userslug', 'picture'], function(err, userData) {
if (err) {
return next(err);
}
notification.image = picture;
notification.image = userData.picture;
notification.user = userData;
next(null, notification);
});
return;