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) { 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)
}, },