aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLunny Xiao2019-07-03 15:15:55 +0800
committertechknowlogick2019-07-03 03:15:55 -0400
commit11f6ed4f8349119c8f9a5d57c43a0312365883d1 (patch)
tree5213314951b3f015f9855114385df2cd8d4c3515
parente94a84248d8caf7f10a0f5eb46b298123409a3b7 (diff)
fix api route (#7346) (#7347)release/v1.8
-rw-r--r--routers/api/v1/api.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 405256afe..c372f97c8 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -698,14 +698,14 @@ func RegisterRoutes(m *macaron.Macaron) {
Delete(reqToken(), reqOrgMembership(), org.ConcealMember)
})
m.Combo("/teams", reqToken(), reqOrgMembership()).Get(org.ListTeams).
- Post(bind(api.CreateTeamOption{}), org.CreateTeam)
+ Post(reqOrgOwnership(), bind(api.CreateTeamOption{}), org.CreateTeam)
m.Group("/hooks", func() {
m.Combo("").Get(org.ListHooks).
Post(bind(api.CreateHookOption{}), org.CreateHook)
m.Combo("/:id").Get(org.GetHook).
- Patch(reqOrgOwnership(), bind(api.EditHookOption{}), org.EditHook).
- Delete(reqOrgOwnership(), org.DeleteHook)
- }, reqToken(), reqOrgMembership())
+ Patch(bind(api.EditHookOption{}), org.EditHook).
+ Delete(org.DeleteHook)
+ }, reqToken(), reqOrgOwnership())
}, orgAssignment(true))
m.Group("/teams/:teamid", func() {
m.Combo("").Get(org.GetTeam).