diff options
author | KN4CK3R <admin@oldschoolhack.me> | 2022-01-05 22:00:20 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-05 15:00:20 -0600 |
commit | bf7b083cfe47cc922090ce7922b89f7a5030a44d (patch) | |
tree | 62291bc31a1dd28252a8802555d09085d30416ee /routers/web/web.go | |
parent | a38ba634a4da15fbb2d1b6ac6742cf01c1503ea4 (diff) | |
download | gitea-bf7b083cfe47cc922090ce7922b89f7a5030a44d.tar.gz gitea-bf7b083cfe47cc922090ce7922b89f7a5030a44d.zip |
Add replay of webhooks. (#18191)
Diffstat (limited to 'routers/web/web.go')
-rw-r--r-- | routers/web/web.go | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/routers/web/web.go b/routers/web/web.go index e35ccb5aab..8abdf7c61f 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -435,7 +435,10 @@ func RegisterRoutes(m *web.Route) { m.Group("/hooks", func() { m.Get("", admin.DefaultOrSystemWebhooks) m.Post("/delete", admin.DeleteDefaultOrSystemWebhook) - m.Get("/{id}", repo.WebHooksEdit) + m.Group("/{id}", func() { + m.Get("", repo.WebHooksEdit) + m.Post("/replay/{uuid}", repo.ReplayWebhook) + }) m.Post("/gitea/{id}", bindIgnErr(forms.NewWebhookForm{}), repo.WebHooksEditPost) m.Post("/gogs/{id}", bindIgnErr(forms.NewGogshookForm{}), repo.GogsHooksEditPost) m.Post("/slack/{id}", bindIgnErr(forms.NewSlackHookForm{}), repo.SlackHooksEditPost) @@ -559,7 +562,10 @@ func RegisterRoutes(m *web.Route) { m.Post("/msteams/new", bindIgnErr(forms.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) m.Post("/feishu/new", bindIgnErr(forms.NewFeishuHookForm{}), repo.FeishuHooksNewPost) m.Post("/wechatwork/new", bindIgnErr(forms.NewWechatWorkHookForm{}), repo.WechatworkHooksNewPost) - m.Get("/{id}", repo.WebHooksEdit) + m.Group("/{id}", func() { + m.Get("", repo.WebHooksEdit) + m.Post("/replay/{uuid}", repo.ReplayWebhook) + }) m.Post("/gitea/{id}", bindIgnErr(forms.NewWebhookForm{}), repo.WebHooksEditPost) m.Post("/gogs/{id}", bindIgnErr(forms.NewGogshookForm{}), repo.GogsHooksEditPost) m.Post("/slack/{id}", bindIgnErr(forms.NewSlackHookForm{}), repo.SlackHooksEditPost) @@ -653,8 +659,11 @@ func RegisterRoutes(m *web.Route) { m.Post("/msteams/new", bindIgnErr(forms.NewMSTeamsHookForm{}), repo.MSTeamsHooksNewPost) m.Post("/feishu/new", bindIgnErr(forms.NewFeishuHookForm{}), repo.FeishuHooksNewPost) m.Post("/wechatwork/new", bindIgnErr(forms.NewWechatWorkHookForm{}), repo.WechatworkHooksNewPost) - m.Get("/{id}", repo.WebHooksEdit) - m.Post("/{id}/test", repo.TestWebhook) + m.Group("/{id}", func() { + m.Get("", repo.WebHooksEdit) + m.Post("/test", repo.TestWebhook) + m.Post("/replay/{uuid}", repo.ReplayWebhook) + }) m.Post("/gitea/{id}", bindIgnErr(forms.NewWebhookForm{}), repo.WebHooksEditPost) m.Post("/gogs/{id}", bindIgnErr(forms.NewGogshookForm{}), repo.GogsHooksEditPost) m.Post("/slack/{id}", bindIgnErr(forms.NewSlackHookForm{}), repo.SlackHooksEditPost) |