diff options
author | Unknwon <u@gogs.io> | 2016-03-25 18:04:02 -0400 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2016-03-25 18:04:02 -0400 |
commit | b1d41cfa603aee63711fbc23bb02fced5a4c54e3 (patch) | |
tree | dc79e8f9c8dec5ab324b27d10108667e7b4d9090 /routers/api/v1/org/org.go | |
parent | 9dda9ef07c03000cb961a80e3c75459c58602009 (diff) | |
download | gitea-b1d41cfa603aee63711fbc23bb02fced5a4c54e3.tar.gz gitea-b1d41cfa603aee63711fbc23bb02fced5a4c54e3.zip |
#1692 add admin APIs to add/remove a user from teams
Diffstat (limited to 'routers/api/v1/org/org.go')
-rw-r--r-- | routers/api/v1/org/org.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/routers/api/v1/org/org.go b/routers/api/v1/org/org.go index b4e52d4862..5b1ea007e3 100644 --- a/routers/api/v1/org/org.go +++ b/routers/api/v1/org/org.go @@ -42,20 +42,12 @@ func ListUserOrgs(ctx *context.APIContext) { // https://github.com/gogits/go-gogs-client/wiki/Organizations#get-an-organization func Get(ctx *context.APIContext) { - org := user.GetUserByParamsName(ctx, ":orgname") - if ctx.Written() { - return - } - ctx.JSON(200, convert.ToOrganization(org)) + ctx.JSON(200, convert.ToOrganization(ctx.Org.Organization)) } // https://github.com/gogits/go-gogs-client/wiki/Organizations#edit-an-organization func Edit(ctx *context.APIContext, form api.EditOrgOption) { - org := user.GetUserByParamsName(ctx, ":orgname") - if ctx.Written() { - return - } - + org := ctx.Org.Organization if !org.IsOwnedBy(ctx.User.Id) { ctx.Status(403) return |