refactor: improve readability (#6173)

This commit is contained in:
Shahan Arshad 2024-11-28 01:22:22 +05:00 committed by GitHub
parent 39f5d633b5
commit e4a61bd88e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -32,7 +32,8 @@ app.param(['to', 'from'], function(req, res, next, num, name){
// Load user by id // Load user by id
app.param('user', function(req, res, next, id){ app.param('user', function(req, res, next, id){
if (req.user = users[id]) { req.user = users[id]
if (req.user) {
next(); next();
} else { } else {
next(createError(404, 'failed to find user')); next(createError(404, 'failed to find user'));