aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'server/controllers')
-rw-r--r--server/controllers/api/users/index.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/server/controllers/api/users/index.ts b/server/controllers/api/users/index.ts
index c8e9eaeaa..839431afb 100644
--- a/server/controllers/api/users/index.ts
+++ b/server/controllers/api/users/index.ts
@@ -18,6 +18,7 @@ import {
18 setDefaultPagination, 18 setDefaultPagination,
19 setDefaultSort, 19 setDefaultSort,
20 userAutocompleteValidator, 20 userAutocompleteValidator,
21 usersListValidator,
21 usersAddValidator, 22 usersAddValidator,
22 usersGetValidator, 23 usersGetValidator,
23 usersRegisterValidator, 24 usersRegisterValidator,
@@ -85,6 +86,7 @@ usersRouter.get('/',
85 usersSortValidator, 86 usersSortValidator,
86 setDefaultSort, 87 setDefaultSort,
87 setDefaultPagination, 88 setDefaultPagination,
89 asyncMiddleware(usersListValidator),
88 asyncMiddleware(listUsers) 90 asyncMiddleware(listUsers)
89) 91)
90 92
@@ -282,7 +284,13 @@ async function autocompleteUsers (req: express.Request, res: express.Response) {
282} 284}
283 285
284async function listUsers (req: express.Request, res: express.Response) { 286async function listUsers (req: express.Request, res: express.Response) {
285 const resultList = await UserModel.listForApi(req.query.start, req.query.count, req.query.sort, req.query.search) 287 const resultList = await UserModel.listForApi({
288 start: req.query.start,
289 count: req.query.count,
290 sort: req.query.sort,
291 search: req.query.search,
292 blocked: req.query.blocked
293 })
286 294
287 return res.json(getFormattedObjects(resultList.data, resultList.total, { withAdminFlags: true })) 295 return res.json(getFormattedObjects(resultList.data, resultList.total, { withAdminFlags: true }))
288} 296}