mirror of
https://codeberg.org/davrot/forgejo.git
synced 2025-05-20 05:00:01 +02:00
API endpoints for organization teams (#370)
This commit is contained in:
parent
c463b1b8cb
commit
f686a32eac
3 changed files with 70 additions and 0 deletions
|
@ -357,6 +357,11 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
Delete(org.DeleteHook)
|
||||
})
|
||||
}, orgAssignment(true))
|
||||
m.Group("/teams/:teamid", func() {
|
||||
m.Get("", org.GetTeam)
|
||||
m.Get("/members", org.GetTeamMembers)
|
||||
m.Get("/repos", org.GetTeamRepos)
|
||||
}, orgAssignment(false, true))
|
||||
|
||||
m.Any("/*", func(ctx *context.Context) {
|
||||
ctx.Error(404)
|
||||
|
@ -382,6 +387,8 @@ func RegisterRoutes(m *macaron.Macaron) {
|
|||
})
|
||||
m.Group("/teams", func() {
|
||||
m.Group("/:teamid", func() {
|
||||
m.Combo("").Patch(bind(api.EditTeamOption{}), admin.EditTeam).
|
||||
Delete(admin.DeleteTeam)
|
||||
m.Combo("/members/:username").Put(admin.AddTeamMember).Delete(admin.RemoveTeamMember)
|
||||
m.Combo("/repos/:reponame").Put(admin.AddTeamRepository).Delete(admin.RemoveTeamRepository)
|
||||
}, orgAssignment(false, true))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue