From 08510503920a375754df4478163967be804ab48c Mon Sep 17 00:00:00 2001 From: Paul Nettleton Date: Tue, 29 Nov 2022 11:43:39 -0600 Subject: [PATCH] Update UserController.js to respond with objects Changes: - `findAll` (GET /api/users) --- server/controllers/UserController.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/controllers/UserController.js b/server/controllers/UserController.js index 27b01b3a..78ced4e9 100644 --- a/server/controllers/UserController.js +++ b/server/controllers/UserController.js @@ -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) {