summaryrefslogtreecommitdiffstats
path: root/routers/api/v1/api.go
diff options
context:
space:
mode:
authorEthan Koenig <ethantkoenig@gmail.com>2016-12-06 23:36:28 -0500
committerKim "BKC" Carlbäcker <kim.carlbacker@gmail.com>2016-12-25 14:51:57 +0100
commit9847b38518fe19e0c764e92c51875443b3741e79 (patch)
tree52509b6813d3b9714a420220af52d697e364ed3b /routers/api/v1/api.go
parentfa3abc22c06843bb27089e8c0f7aebf0f5d83fcc (diff)
downloadgitea-9847b38518fe19e0c764e92c51875443b3741e79.tar.gz
gitea-9847b38518fe19e0c764e92c51875443b3741e79.zip
Organization webhook API endpoints
Diffstat (limited to 'routers/api/v1/api.go')
-rw-r--r--routers/api/v1/api.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/routers/api/v1/api.go b/routers/api/v1/api.go
index 11adfa5c5f..d697786e27 100644
--- a/routers/api/v1/api.go
+++ b/routers/api/v1/api.go
@@ -266,7 +266,8 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/hooks", func() {
m.Combo("").Get(repo.ListHooks).
Post(bind(api.CreateHookOption{}), repo.CreateHook)
- m.Combo("/:id").Patch(bind(api.EditHookOption{}), repo.EditHook).
+ m.Combo("/:id").Get(repo.GetHook).
+ Patch(bind(api.EditHookOption{}), repo.EditHook).
Delete(repo.DeleteHook)
})
m.Put("/collaborators/:collaborator", bind(api.AddCollaboratorOption{}), repo.AddCollaborator)
@@ -343,6 +344,13 @@ func RegisterRoutes(m *macaron.Macaron) {
m.Group("/orgs/:orgname", func() {
m.Combo("").Get(org.Get).Patch(bind(api.EditOrgOption{}), org.Edit)
m.Combo("/teams").Get(org.ListTeams)
+ m.Group("/hooks", func() {
+ m.Combo("").Get(org.ListHooks).
+ Post(bind(api.CreateHookOption{}), org.CreateHook)
+ m.Combo("/:id").Get(org.GetHook).
+ Patch(bind(api.EditHookOption{}), org.EditHook).
+ Delete(org.DeleteHook)
+ })
}, orgAssignment(true))
m.Any("/*", func(ctx *context.Context) {