diff options
author | Unknwon <u@gogs.io> | 2016-03-13 18:49:16 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-13 18:49:16 -0400 |
commit | dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48 (patch) | |
tree | 7f9e4107eb961712a56160ef544143eee3771653 /routers/api/v1/admin/orgs.go | |
parent | db4da7beecd6a8f65bfa264ba18a8cb12303921f (diff) | |
download | gitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.tar.gz gitea-dd6faf7f9bd0a1dbf986e124ea0f4db249e1da48.zip |
Convert all API handers to use *context.APIContext
Diffstat (limited to 'routers/api/v1/admin/orgs.go')
-rw-r--r-- | routers/api/v1/admin/orgs.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/admin/orgs.go b/routers/api/v1/admin/orgs.go index f212c4f517..1e7ad15657 100644 --- a/routers/api/v1/admin/orgs.go +++ b/routers/api/v1/admin/orgs.go @@ -14,7 +14,7 @@ import ( ) // https://github.com/gogits/go-gogs-client/wiki/Administration-Organizations#create-a-new-organization -func CreateOrg(ctx *context.Context, form api.CreateOrgOption) { +func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) { u := user.GetUserByParams(ctx) if ctx.Written() { return @@ -33,9 +33,9 @@ func CreateOrg(ctx *context.Context, form api.CreateOrgOption) { if models.IsErrUserAlreadyExist(err) || models.IsErrNameReserved(err) || models.IsErrNamePatternNotAllowed(err) { - ctx.APIError(422, "CreateOrganization", err) + ctx.Error(422, "CreateOrganization", err) } else { - ctx.APIError(500, "CreateOrganization", err) + ctx.Error(500, "CreateOrganization", err) } return } |