Update:API endpoint for get all users to use minimal payload

This commit is contained in:
advplyr 2023-03-29 14:56:50 -05:00
parent d2e0844493
commit 575a162f8b
3 changed files with 11 additions and 9 deletions

View file

@ -11,9 +11,9 @@ class UserController {
findAll(req, res) {
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: users
// Minimal toJSONForBrowser does not include mediaProgress and bookmarks
users: this.db.users.map(u => u.toJSONForBrowser(hideRootToken, true))
})
}