summaryrefslogtreecommitdiffstats
path: root/routers/web/repo
diff options
context:
space:
mode:
authoroliverpool <git@olivier.pfad.fr>2024-03-22 16:02:48 +0100
committeroliverpool <git@olivier.pfad.fr>2024-03-30 15:59:56 +0100
commit120fa61a0a720de8d82c4bf9e65e77d8a0bddf87 (patch)
treea155db7810f4ecfdcd607e7beb3ccccf9e6e4453 /routers/web/repo
parentMerge pull request 'Update module github.com/felixge/fgprof to v0.9.4' (#2805... (diff)
downloadforgejo-120fa61a0a720de8d82c4bf9e65e77d8a0bddf87.tar.xz
forgejo-120fa61a0a720de8d82c4bf9e65e77d8a0bddf87.zip
[REFACTOR] add Icon to webhook.Interface
Diffstat (limited to 'routers/web/repo')
-rw-r--r--routers/web/repo/setting/webhook.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/setting/webhook.go b/routers/web/repo/setting/webhook.go
index bf7770bfdb..c36ebf5b14 100644
--- a/routers/web/repo/setting/webhook.go
+++ b/routers/web/repo/setting/webhook.go
@@ -132,11 +132,13 @@ func WebhookNew(ctx *context.Context) {
}
hookType := ctx.Params(":type")
- if webhook_service.GetWebhookHandler(hookType) == nil {
+ handler := webhook_service.GetWebhookHandler(hookType)
+ if handler == nil {
ctx.NotFound("GetWebhookHandler", nil)
return
}
ctx.Data["HookType"] = hookType
+ ctx.Data["WebhookHandler"] = handler
ctx.Data["BaseLink"] = orCtx.LinkNew
ctx.Data["BaseLinkNew"] = orCtx.LinkNew
@@ -194,6 +196,7 @@ func WebhookCreate(ctx *context.Context) {
ctx.Data["PageIsSettingsHooksNew"] = true
ctx.Data["Webhook"] = webhook.Webhook{HookEvent: &webhook_module.HookEvent{}}
ctx.Data["HookType"] = hookType
+ ctx.Data["WebhookHandler"] = handler
orCtx, err := getOwnerRepoCtx(ctx)
if err != nil {
@@ -358,6 +361,7 @@ func checkWebhook(ctx *context.Context) (*ownerRepoCtx, *webhook.Webhook) {
if handler := webhook_service.GetWebhookHandler(w.Type); handler != nil {
ctx.Data["HookMetadata"] = handler.Metadata(w)
+ ctx.Data["WebhookHandler"] = handler
}
ctx.Data["History"], err = w.History(ctx, 1)