diff options
author | oliverpool <git@olivier.pfad.fr> | 2024-03-21 14:02:14 +0100 |
---|---|---|
committer | oliverpool <git@olivier.pfad.fr> | 2024-03-27 15:38:39 +0100 |
commit | 6b719f08d0fed21502925d86cfd94cad19510b2c (patch) | |
tree | 1f73220cdd2cf926ab5cf80d8ba295b6a3e15dcc /routers | |
parent | [REFACTOR] webhook msteams endpoint (diff) | |
download | forgejo-6b719f08d0fed21502925d86cfd94cad19510b2c.tar.xz forgejo-6b719f08d0fed21502925d86cfd94cad19510b2c.zip |
[REFACTOR] webhook feishu 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 ead24614f1..b44da2510b 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 { } } -// FeishuHooksNewPost response for creating Feishu webhook -func FeishuHooksNewPost(ctx *context.Context) { - createWebhook(ctx, feishuHookParams(ctx)) -} - -// FeishuHooksEditPost response for editing Feishu webhook -func FeishuHooksEditPost(ctx *context.Context) { - editWebhook(ctx, feishuHookParams(ctx)) -} - -func feishuHookParams(ctx *context.Context) webhookParams { - form := web.GetForm(ctx).(*forms.NewFeishuHookForm) - - return webhookParams{ - Type: webhook_module.FEISHU, - URL: form.PayloadURL, - ContentType: webhook.ContentTypeJSON, - WebhookForm: form.WebhookForm, - } -} - // WechatworkHooksNewPost response for creating Wechatwork webhook func WechatworkHooksNewPost(ctx *context.Context) { createWebhook(ctx, wechatworkHookParams(ctx)) diff --git a/routers/web/web.go b/routers/web/web.go index 6d2e380e06..fb4510af5b 100644 --- a/routers/web/web.go +++ b/routers/web/web.go @@ -403,7 +403,6 @@ 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("/feishu/new", web.Bind(forms.NewFeishuHookForm{}), repo_setting.FeishuHooksNewPost) 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) @@ -411,7 +410,6 @@ func registerRoutes(m *web.Route) { addWebhookEditRoutes := func() { m.Post("/gogs/{id}", web.Bind(forms.NewGogshookForm{}), repo_setting.GogsHooksEditPost) - m.Post("/feishu/{id}", web.Bind(forms.NewFeishuHookForm{}), repo_setting.FeishuHooksEditPost) 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) |