mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-06-24 10:00:50 +00:00
Return a UserList from /api/v1/admin/users (#6629)
This commit is contained in:
parent
74fc63682c
commit
837116875e
4 changed files with 50 additions and 13 deletions
|
@ -10,6 +10,7 @@ import (
|
|||
"code.gitea.io/gitea/modules/context"
|
||||
"code.gitea.io/gitea/modules/log"
|
||||
"code.gitea.io/gitea/modules/setting"
|
||||
"code.gitea.io/gitea/routers/api/v1/convert"
|
||||
"code.gitea.io/gitea/routers/api/v1/user"
|
||||
api "code.gitea.io/sdk/gitea"
|
||||
)
|
||||
|
@ -319,8 +320,14 @@ func GetAllUsers(ctx *context.APIContext) {
|
|||
PageSize: -1,
|
||||
})
|
||||
if err != nil {
|
||||
ctx.Error(500, "SearchUsers", err)
|
||||
ctx.Error(500, "GetAllUsers", err)
|
||||
return
|
||||
}
|
||||
ctx.JSON(200, &users)
|
||||
|
||||
results := make([]*api.User, len(users))
|
||||
for i := range users {
|
||||
results[i] = convert.ToUser(users[i], ctx.IsSigned, ctx.User.IsAdmin)
|
||||
}
|
||||
|
||||
ctx.JSON(200, &results)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue