API endpoints for organization teams (#370)
This commit is contained in:
@ -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))
|
||||
|
Reference in New Issue
Block a user