User profile

develop
sundowndev 2018-11-17 00:43:34 +01:00
parent 9b5023d659
commit 46d54d339f
1 changed files with 1 additions and 7 deletions

View File

@ -9,12 +9,6 @@ module.exports = (req, res, next) => {
return UserModel.findById(user.id, 'id firstname lastname email')
.lean()
.exec()
.then((result) => {
if (result === null) {
return next({ status: 401, message: 'User does not exists.' });
}
return res.status(200).json(result);
})
.then(result => res.status(200).json(result))
.catch(() => next({ status: 401, message: 'User does not exists.' }));
};