mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-05-04 13:50:39 +00:00
Change list teams API to non-admin specific
This commit is contained in:
parent
e6f927f61a
commit
90e93b1f3a
4 changed files with 38 additions and 22 deletions
|
@ -205,7 +205,10 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
// Organizations
|
||||
m.Get("/user/orgs", ReqToken(), org.ListMyOrgs)
|
||||
m.Get("/users/:username/orgs", org.ListUserOrgs)
|
||||
m.Combo("/orgs/:orgname").Get(org.Get).Patch(bind(api.EditOrgOption{}), org.Edit)
|
||||
m.Group("/orgs/:orgname", func() {
|
||||
m.Combo("").Get(org.Get).Patch(bind(api.EditOrgOption{}), org.Edit)
|
||||
m.Combo("/teams").Get(org.ListTeams)
|
||||
})
|
||||
|
||||
m.Any("/*", func(ctx *context.Context) {
|
||||
ctx.Error(404)
|
||||
|
@ -225,7 +228,7 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
})
|
||||
|
||||
m.Group("/orgs/:orgname", func() {
|
||||
m.Combo("/teams").Get(admin.ListTeams).Post(bind(api.CreateTeamOption{}), admin.CreateTeam)
|
||||
m.Combo("/teams").Post(bind(api.CreateTeamOption{}), admin.CreateTeam)
|
||||
})
|
||||
}, ReqAdmin())
|
||||
}, context.APIContexter())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue