mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-06-16 21:06:35 +08:00
fix return callbacks
This commit is contained in:
parent
9e22122832
commit
9731e8ccc6
@ -144,17 +144,17 @@ module.exports = function(User) {
|
||||
}
|
||||
User.findOne({ where: { username } }, (err, user) => {
|
||||
if (err) {
|
||||
cb(err);
|
||||
return cb(err);
|
||||
}
|
||||
if (!user || user.username !== username) {
|
||||
cb(new Error('FCC: no user found for %s', username));
|
||||
return cb(new Error('FCC: no user found for %s', username));
|
||||
}
|
||||
const aboutUser = {
|
||||
username: user.username,
|
||||
bio: user.bio,
|
||||
github: user.githubProfile
|
||||
};
|
||||
cb(null, aboutUser);
|
||||
return cb(null, aboutUser);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user