Skip to content

Commit

Permalink
BugFix: fix HoundCI violations
Browse files Browse the repository at this point in the history
  • Loading branch information
d-beloved committed Sep 18, 2018
1 parent 52b2947 commit fddfef9
Showing 1 changed file with 15 additions and 19 deletions.
34 changes: 15 additions & 19 deletions server/controllers/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,35 +275,31 @@ class UsersController {
static adminGetUsers(req, res, next) {
const { role } = req.query;
if (!role) {
User.findAll(
{
where: {
role: {
[Op.or]: ['user', 'author']
}
},
attributes: {
exclude: ['hash']
User.findAll({
where: {
role: {
[Op.or]: ['user', 'author']
}
},
attributes: {
exclude: ['hash']
}
)
})
.then(users => res.status(200).json({
// add success message here.
message: 'All registered users returned',
status: 'success',
profiles: users,
})).catch(next);
} else {
User.findAll(
{
where: {
role
},
attributes: {
exclude: ['hash']
}
User.findAll({
where: {
role
},
attributes: {
exclude: ['hash']
}
)
})
.then(users => res.status(200).json({
// add success message here.
message: 'All registered users/authors returned',
Expand Down

0 comments on commit fddfef9

Please sign in to comment.