show admin users first

This commit is contained in:
les 2019-11-09 15:05:33 +01:00
parent 73603e16dc
commit 1afc30fb48

View file

@ -209,8 +209,8 @@ const userController = {
},
async getAll (req, res) {
const users = await User.findAll({
order: [['createdAt', 'DESC']]
const users = await User.scope('withoutPassword').findAll({
order: [['is_admin', 'DESC'], ['createdAt', 'DESC']]
})
res.json(users)
},