diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2019-07-03 13:31:29 +0800 |
---|---|---|
committer | zeripath <art27@cantab.net> | 2019-07-03 06:31:29 +0100 |
commit | b5aa7f7ceb4ca828f50395e404e19c5ba7679268 (patch) | |
tree | 753ceba45adcc2705c290e48902a9df2d398d470 /routers | |
parent | 68ec7b8be9d945ffb83431ba1113997cfc9e648c (diff) | |
download | gitea-b5aa7f7ceb4ca828f50395e404e19c5ba7679268.tar.gz gitea-b5aa7f7ceb4ca828f50395e404e19c5ba7679268.zip |
fix api route (#7346)
Diffstat (limited to 'routers')
-rw-r--r-- | routers/api/v1/api.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 8e7a74eca2..8170b79dd2 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -798,14 +798,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). |