Skip to content

Commit

Permalink
refactor: improve readability (#6173)
Browse files Browse the repository at this point in the history
  • Loading branch information
sazk07 authored Nov 27, 2024
1 parent 39f5d63 commit e4a61bd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion examples/params/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ app.param(['to', 'from'], function(req, res, next, num, name){
// Load user by id

app.param('user', function(req, res, next, id){
if (req.user = users[id]) {
req.user = users[id]
if (req.user) {
next();
} else {
next(createError(404, 'failed to find user'));
Expand Down

0 comments on commit e4a61bd

Please sign in to comment.