Update UserController.js to respond with objects

Changes:
- `findAll` (GET /api/users)
This commit is contained in:
Paul Nettleton 2022-11-29 11:43:39 -06:00
parent b84882d9d1
commit 0851050392

View File

@ -12,7 +12,9 @@ class UserController {
if (!req.user.isAdminOrUp) return res.sendStatus(403)
const hideRootToken = !req.user.isRoot
const users = this.db.users.map(u => this.userJsonWithItemProgressDetails(u, hideRootToken))
res.json(users)
res.json({
users: users
})
}
findOne(req, res) {