aboutsummaryrefslogtreecommitdiff
path: root/routers/api/v1/user/user.go
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
committerUnknwon <u@gogs.io>2016-03-13 18:49:16 -0400
commitdd6faf7f9bd0a1dbf986e124ea0f4db249e1da48 (patch)
tree7f9e4107eb961712a56160ef544143eee3771653 /routers/api/v1/user/user.go
parentdb4da7beecd6a8f65bfa264ba18a8cb12303921f (diff)
Convert all API handers to use *context.APIContext
Diffstat (limited to 'routers/api/v1/user/user.go')
-rw-r--r--routers/api/v1/user/user.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/user/user.go b/routers/api/v1/user/user.go
index 71056894..b460d942 100644
--- a/routers/api/v1/user/user.go
+++ b/routers/api/v1/user/user.go
@@ -14,7 +14,7 @@ import (
)
// https://github.com/gogits/go-gogs-client/wiki/Users#search-users
-func Search(ctx *context.Context) {
+func Search(ctx *context.APIContext) {
opts := &models.SearchUserOptions{
Keyword: ctx.Query("q"),
Type: models.USER_TYPE_INDIVIDUAL,
@@ -53,13 +53,13 @@ func Search(ctx *context.Context) {
}
// https://github.com/gogits/go-gogs-client/wiki/Users#get-a-single-user
-func GetInfo(ctx *context.Context) {
+func GetInfo(ctx *context.APIContext) {
u, err := models.GetUserByName(ctx.Params(":username"))
if err != nil {
if models.IsErrUserNotExist(err) {
- ctx.Error(404)
+ ctx.Status(404)
} else {
- ctx.APIError(500, "GetUserByName", err)
+ ctx.Error(500, "GetUserByName", err)
}
return
}