feat(users): populate invited_by user info when login

This commit is contained in:
OldHawk
2017-09-13 18:29:15 +08:00
parent 77f3765d0c
commit 674209ebf9
3 changed files with 20 additions and 18 deletions

View File

@@ -19,7 +19,7 @@ exports.userByID = function (req, res, next, id) {
User.findOne({
_id: id
}).exec(function (err, user) {
}).populate('invited_by', 'username displayName profileImageURL').exec(function (err, user) {
if (err) {
return next(err);
} else if (!user) {