feat(users): add invited_by filed to model user

This commit is contained in:
OldHawk
2017-09-13 14:54:58 +08:00
parent 87b1a482f4
commit 09f1fbbb3b
4 changed files with 21 additions and 3 deletions

View File

@@ -349,7 +349,9 @@ exports.userByID = function (req, res, next, id) {
});
}
User.findById(id, '-salt -password -providerData').exec(function (err, user) {
User.findById(id, '-salt -password -providerData')
.populate('invited_by', 'username displayName profileImageURL')
.exec(function (err, user) {
if (err) {
return next(err);
} else if (!user) {