mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-28 03:00:03 +02:00
Replace convert.To with APIFormat calls
This commit is contained in:
parent
3f7f4852ef
commit
dccb0c15b9
21 changed files with 79 additions and 225 deletions
|
@ -9,13 +9,12 @@ import (
|
|||
|
||||
"github.com/gogits/gogs/models"
|
||||
"github.com/gogits/gogs/modules/context"
|
||||
"github.com/gogits/gogs/routers/api/v1/convert"
|
||||
)
|
||||
|
||||
func responseApiUsers(ctx *context.APIContext, users []*models.User) {
|
||||
apiUsers := make([]*api.User, len(users))
|
||||
for i := range users {
|
||||
apiUsers[i] = convert.ToUser(users[i])
|
||||
apiUsers[i] = users[i].APIFormat()
|
||||
}
|
||||
ctx.JSON(200, &apiUsers)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue