diff options
author | 6543 | 2020-05-12 07:46:44 +0200 |
---|---|---|
committer | GitHub | 2020-05-12 08:46:44 +0300 |
commit | d78be7ddf96c991c91b9e4a02b646f52eb3c21f6 (patch) | |
tree | 420581ff8a75d8a348a62d868f44f87402de24e3 | |
parent | 83f8414e1ee769a62ae813b10f602a800eb76ac5 (diff) |
Fix /api/v1/orgs/* endpoints by changing parameter to :org from :orgname (#11381)
-rw-r--r-- | routers/api/v1/api.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index e4288f40f..a19666ff5 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -382,7 +382,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() @@ -808,7 +808,7 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("/user/orgs", reqToken(), org.ListMyOrgs) m.Get("/users/:username/orgs", org.ListUserOrgs) m.Post("/orgs", reqToken(), bind(api.CreateOrgOption{}), org.Create) - m.Group("/orgs/:orgname", func() { + m.Group("/orgs/:org", func() { m.Get("/repos", user.ListOrgRepos) m.Combo("").Get(org.Get). Patch(reqToken(), reqOrgOwnership(), bind(api.EditOrgOption{}), org.Edit). @@ -850,7 +850,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) }) |