show admin users first
This commit is contained in:
@@ -209,8 +209,8 @@ const userController = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getAll (req, res) {
|
async getAll (req, res) {
|
||||||
const users = await User.findAll({
|
const users = await User.scope('withoutPassword').findAll({
|
||||||
order: [['createdAt', 'DESC']]
|
order: [['is_admin', 'DESC'], ['createdAt', 'DESC']]
|
||||||
})
|
})
|
||||||
res.json(users)
|
res.json(users)
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user