Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly set the organization num repos #11339

Merged
merged 9 commits into from
May 11, 2020
Merged
Prev Previous commit
remove orgname from api
Signed-off-by: Andrew Thornton <[email protected]>
  • Loading branch information
zeripath committed May 11, 2020
commit 0af8b3592621688bcc363a2b07aacaaf58774c48
6 changes: 3 additions & 3 deletions routers/api/v1/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ func orgAssignment(args ...bool) macaron.Handler {

var err error
if assignOrg {
ctx.Org.Organization, err = models.GetOrgByName(ctx.Params(":orgname"))
ctx.Org.Organization, err = models.GetOrgByName(ctx.Params(":org"))
if err != nil {
if models.IsErrOrgNotExist(err) {
ctx.NotFound()
Expand Down Expand Up @@ -857,7 +857,7 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Get("/users/:username/orgs", org.ListUserOrgs)
m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.Create)
m.Get("/orgs", org.GetAll)
m.Group("/orgs/:orgname", func() {
m.Group("/orgs/:org", func() {
m.Combo("").Get(org.Get).
Patch(reqToken(), reqOrgOwnership(), bind(api.EditOrgOption{}), org.Edit).
Delete(reqToken(), reqOrgOwnership(), org.Delete)
Expand Down Expand Up @@ -907,7 +907,7 @@ func RegisterRoutes(m *macaron.Macaron) {
})
m.Group("/repos", func() {
m.Get("", org.GetTeamRepos)
m.Combo("/:orgname/:reponame").
m.Combo("/:org/:reponame").
Put(org.AddTeamRepository).
Delete(org.RemoveTeamRepository)
})
Expand Down
2 changes: 1 addition & 1 deletion routers/api/v1/repo/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ func CreateOrgRepo(ctx *context.APIContext, opt api.CreateRepoOption) {
// "403":
// "$ref": "#/responses/forbidden"

org, err := models.GetOrgByName(ctx.Params(":orgname"))
org, err := models.GetOrgByName(ctx.Params(":org"))
if err != nil {
if models.IsErrOrgNotExist(err) {
ctx.Error(http.StatusUnprocessableEntity, "", err)
Expand Down