diff options
Diffstat (limited to 'routers/api/v1/admin')
-rw-r--r-- | routers/api/v1/admin/org.go | 2 | ||||
-rw-r--r-- | routers/api/v1/admin/org_team.go | 20 |
2 files changed, 2 insertions, 20 deletions
diff --git a/routers/api/v1/admin/org.go b/routers/api/v1/admin/org.go index fcce3b9314..e82fc3ed66 100644 --- a/routers/api/v1/admin/org.go +++ b/routers/api/v1/admin/org.go @@ -33,7 +33,7 @@ func CreateOrg(ctx *context.APIContext, form api.CreateOrgOption) { if models.IsErrUserAlreadyExist(err) || models.IsErrNameReserved(err) || models.IsErrNamePatternNotAllowed(err) { - ctx.Error(422, "CreateOrganization", err) + ctx.Error(422, "", err) } else { ctx.Error(500, "CreateOrganization", err) } diff --git a/routers/api/v1/admin/org_team.go b/routers/api/v1/admin/org_team.go index 618dd9a948..e3f9a1f1f0 100644 --- a/routers/api/v1/admin/org_team.go +++ b/routers/api/v1/admin/org_team.go @@ -13,24 +13,6 @@ import ( "github.com/gogits/gogs/routers/api/v1/user" ) -func ListTeams(ctx *context.APIContext) { - org := user.GetUserByParamsName(ctx, ":orgname") - if ctx.Written() { - return - } - - if err := org.GetTeams(); err != nil { - ctx.Error(500, "GetTeams", err) - return - } - - apiTeams := make([]*api.Team, len(org.Teams)) - for i := range org.Teams { - apiTeams[i] = convert.ToTeam(org.Teams[i]) - } - ctx.JSON(200, apiTeams) -} - func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) { org := user.GetUserByParamsName(ctx, ":orgname") if ctx.Written() { @@ -45,7 +27,7 @@ func CreateTeam(ctx *context.APIContext, form api.CreateTeamOption) { } if err := models.NewTeam(team); err != nil { if models.IsErrTeamAlreadyExist(err) { - ctx.Error(422, "NewTeam", err) + ctx.Error(422, "", err) } else { ctx.Error(500, "NewTeam", err) } |