diff options
author | Rémy Boulanouar <rboulanouar@gmail.com> | 2017-05-29 09:17:15 +0200 |
---|---|---|
committer | Bo-Yi Wu <appleboy.tw@gmail.com> | 2017-05-29 02:17:15 -0500 |
commit | e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b (patch) | |
tree | 44e906f5ac3a322832e5d9a55ea59bf613d36b24 /routers/routes | |
parent | e67ece26f0b97437200998b9b153b4c3a87a65aa (diff) | |
download | gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.tar.gz gitea-e0c6ab2d44d17b72a7ea6f8b4c829c42baeaae3b.zip |
Add Gitea Webhook (#1755)
* Replace Gogs by Gitea
* Fix missing changes
* Create Gitea webhook and put Gogs webhook apart.
Diffstat (limited to 'routers/routes')
-rw-r--r-- | routers/routes/routes.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/routers/routes/routes.go b/routers/routes/routes.go index f1c55e1705..0781aef89d 100644 --- a/routers/routes/routes.go +++ b/routers/routes/routes.go @@ -379,10 +379,12 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("", org.Webhooks) m.Post("/delete", org.DeleteWebhook) m.Get("/:type/new", repo.WebhooksNew) - m.Post("/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) + m.Post("/gitea/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) + m.Post("/gogs/new", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksNewPost) m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost) m.Get("/:id", repo.WebHooksEdit) - m.Post("/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/gogs/:id", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksEditPost) m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) }) @@ -423,11 +425,13 @@ func RegisterRoutes(m *macaron.Macaron) { m.Get("", repo.Webhooks) m.Post("/delete", repo.DeleteWebhook) m.Get("/:type/new", repo.WebhooksNew) - m.Post("/gogs/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) + m.Post("/gitea/new", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksNewPost) + m.Post("/gogs/new", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksNewPost) m.Post("/slack/new", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksNewPost) m.Get("/:id", repo.WebHooksEdit) m.Post("/:id/test", repo.TestWebhook) - m.Post("/gogs/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/gitea/:id", bindIgnErr(auth.NewWebhookForm{}), repo.WebHooksEditPost) + m.Post("/gogs/:id", bindIgnErr(auth.NewGogshookForm{}), repo.GogsHooksNewPost) m.Post("/slack/:id", bindIgnErr(auth.NewSlackHookForm{}), repo.SlackHooksEditPost) m.Group("/git", func() { |