1
0
Fork 0
forked from forgejo/forgejo

Replace convert.To with APIFormat calls

This commit is contained in:
Unknwon 2016-08-14 04:17:26 -07:00
parent 3f7f4852ef
commit dccb0c15b9
21 changed files with 79 additions and 225 deletions

View file

@ -11,7 +11,6 @@ import (
"github.com/gogits/gogs/models"
"github.com/gogits/gogs/modules/context"
"github.com/gogits/gogs/routers/api/v1/convert"
)
func Search(ctx *context.APIContext) {
@ -67,9 +66,9 @@ func GetInfo(ctx *context.APIContext) {
if !ctx.IsSigned {
u.Email = ""
}
ctx.JSON(200, convert.ToUser(u))
ctx.JSON(200, u.APIFormat())
}
func GetAuthenticatedUser(ctx *context.APIContext) {
ctx.JSON(200, convert.ToUser(ctx.User))
ctx.JSON(200, ctx.User.APIFormat())
}