diff options
author | oliverpool <git@olivier.pfad.fr> | 2024-03-21 14:03:15 +0100 |
---|---|---|
committer | oliverpool <git@olivier.pfad.fr> | 2024-03-27 15:38:39 +0100 |
commit | 36a1d375326293b176768d11a82937db30e63d92 (patch) | |
tree | 38f55804abacf757837ab0532795e9e652cd9de2 /routers | |
parent | [REFACTOR] webhook feishu endpoint (diff) | |
download | forgejo-36a1d375326293b176768d11a82937db30e63d92.tar.xz forgejo-36a1d375326293b176768d11a82937db30e63d92.zip |
[REFACTOR] webhook wechatwork endpoint
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/setting/webhook.go | 21 | ||||
-rw-r--r-- | routers/web/web.go | 2 |
2 files changed, 0 insertions, 23 deletions
diff --git a/routers/web/repo/setting/webhook.go b/routers/web/repo/setting/webhook.go index b44da2510b..a1021c1967 100644 --- a/routers/web/repo/setting/webhook.go +++ b/routers/web/repo/setting/webhook.go @@ -388,27 +388,6 @@ func gogsHookParams(ctx *context.Context) webhookParams { } } -// WechatworkHooksNewPost response for creating Wechatwork webhook -func WechatworkHooksNewPost(ctx *context.Context) { - createWebhook(ctx, wechatworkHookParams(ctx)) -} - -// WechatworkHooksEditPost response for editing Wechatwork webhook -func WechatworkHooksEditPost(ctx *context.Context) { - editWebhook(ctx, wechatworkHookParams(ctx)) -} - -func wechatworkHookParams(ctx *context.Context) webhookParams { - form := web.GetForm(ctx).(*forms.NewWechatWorkHookForm) - - return webhookParams{ - Type: webhook_module.WECHATWORK, - URL: form.PayloadURL, - ContentType: webhook.ContentTypeJSON, - WebhookForm: form.WebhookForm, - } -} - // PackagistHooksNewPost response for creating Packagist webhook func PackagistHooksNewPost(ctx *context.Context) { createWebhook(ctx, packagistHookParams(ctx)) diff --git a/routers/web/web.go b/routers/web/web.go index fb4510af5b..81ff59499d 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -403,14 +403,12 @@ func registerRoutes(m *web.Route) { addWebhookAddRoutes := func() { m.Get("/{type}/new", repo_setting.WebhooksNew) m.Post("/gogs/new", web.Bind(forms.NewGogshookForm{}), repo_setting.GogsHooksNewPost) - m.Post("/wechatwork/new", web.Bind(forms.NewWechatWorkHookForm{}), repo_setting.WechatworkHooksNewPost) m.Post("/packagist/new", web.Bind(forms.NewPackagistHookForm{}), repo_setting.PackagistHooksNewPost) m.Post("/{type}/new", repo_setting.WebhookCreate) } addWebhookEditRoutes := func() { m.Post("/gogs/{id}", web.Bind(forms.NewGogshookForm{}), repo_setting.GogsHooksEditPost) - m.Post("/wechatwork/{id}", web.Bind(forms.NewWechatWorkHookForm{}), repo_setting.WechatworkHooksEditPost) m.Post("/packagist/{id}", web.Bind(forms.NewPackagistHookForm{}), repo_setting.PackagistHooksEditPost) m.Post("/{type}/{id:[0-9]+}", repo_setting.WebhookUpdate) } |