diff options
author | Dennis Chen <barracks510@gmail.com> | 2016-07-16 19:08:38 -0500 |
---|---|---|
committer | 无闻 <u@gogs.io> | 2016-07-17 08:08:38 +0800 |
commit | 5ff2dfb23eb4f5c436d69cc86945192eb4b3d279 (patch) | |
tree | ed98b252b5046253489a52f1faf54e913c361c05 /routers/api/v1/api.go | |
parent | eac32419fcc68fc2e49497ee2f81beb4b6f6178f (diff) | |
download | gitea-5ff2dfb23eb4f5c436d69cc86945192eb4b3d279.tar.gz gitea-5ff2dfb23eb4f5c436d69cc86945192eb4b3d279.zip |
api: delete repository webhooks (#3275)
Allows the deletion of a webhook from a repository at the
/:user/:repo/hooks/:id endpoint.
Solves drone/drone issue #1603.
Signed-off-by: Dennis Chen <barracks510@gmail.com>
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r-- | routers/api/v1/api.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go index 5050b8cb7d..f60bb58bd4 100644 --- a/routers/api/v1/api.go +++ b/routers/api/v1/api.go @@ -221,9 +221,12 @@ func RegisterRoutes(m *macaron.Macaron) { Delete(repo.Delete) m.Group("/:username/:reponame", func() { - m.Combo("/hooks").Get(repo.ListHooks). - Post(bind(api.CreateHookOption{}), repo.CreateHook) - m.Patch("/hooks/:id:int", bind(api.EditHookOption{}), repo.EditHook) + m.Group("/hooks", func() { + m.Combo("").Get(repo.ListHooks). + Post(bind(api.CreateHookOption{}), repo.CreateHook) + m.Combo("/:id:int").Patch(bind(api.EditHookOption{}), repo.EditHook). + Delete(repo.DeleteHook) + }) m.Get("/raw/*", context.RepoRef(), repo.GetRawFile) m.Get("/archive/*", repo.GetArchive) m.Group("/branches", func() { |