User profile
parent
9b5023d659
commit
46d54d339f
|
@ -9,12 +9,6 @@ module.exports = (req, res, next) => {
|
||||||
return UserModel.findById(user.id, 'id firstname lastname email')
|
return UserModel.findById(user.id, 'id firstname lastname email')
|
||||||
.lean()
|
.lean()
|
||||||
.exec()
|
.exec()
|
||||||
.then((result) => {
|
.then(result => res.status(200).json(result))
|
||||||
if (result === null) {
|
|
||||||
return next({ status: 401, message: 'User does not exists.' });
|
|
||||||
}
|
|
||||||
|
|
||||||
return res.status(200).json(result);
|
|
||||||
})
|
|
||||||
.catch(() => next({ status: 401, message: 'User does not exists.' }));
|
.catch(() => next({ status: 401, message: 'User does not exists.' }));
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue