From b1d41cfa603aee63711fbc23bb02fced5a4c54e3 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 25 Mar 2016 18:04:02 -0400 Subject: #1692 add admin APIs to add/remove a user from teams --- routers/api/v1/org/org.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'routers/api/v1/org/org.go') 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 -- cgit v1.2.3