chore: commit lint fixes for the api

This commit is contained in:
Bouncey
2019-02-06 14:19:58 +00:00
committed by mrugesh mohapatra
parent 010fa63e76
commit 07266b7e43
17 changed files with 159 additions and 154 deletions

View File

@ -69,15 +69,15 @@ export default () => function authorizeByJWT(req, res, next) {
if (!req.user) {
const User = loopback.getModelByType('User');
return User.findById(userId)
.then(user => {
if (user) {
user.points = user.progressTimestamps.length;
req.user = user;
}
return;
})
.then(next)
.catch(next);
.then(user => {
if (user) {
user.points = user.progressTimestamps.length;
req.user = user;
}
return;
})
.then(next)
.catch(next);
} else {
return next();
}