MCPcopy Create free account
hub / github.com/gogs/gogs / WebhooksEditPost

Function WebhooksEditPost

internal/route/repo/webhook.go:364–385  ·  view source on GitHub ↗
(c *context.Context, orCtx *orgRepoContext, f form.NewWebhook)

Source from the content-addressed store, hash-verified

362}
363
364func WebhooksEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewWebhook) {
365 c.Title("repo.settings.update_webhook")
366 c.PageIs("SettingsHooks")
367 c.PageIs("SettingsHooksEdit")
368
369 w := loadWebhook(c, orCtx)
370 if c.Written() {
371 return
372 }
373
374 contentType := database.JSON
375 if database.HookContentType(f.ContentType) == database.FORM {
376 contentType = database.FORM
377 }
378
379 w.URL = f.PayloadURL
380 w.ContentType = contentType
381 w.Secret = f.Secret
382 w.HookEvent = toHookEvent(f.Webhook)
383 w.IsActive = f.Active
384 validateAndUpdateWebhook(c, orCtx, w)
385}
386
387func WebhooksSlackEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewSlackHook) {
388 c.Title("repo.settings.update_webhook")

Callers

nothing calls this directly

Calls 6

HookContentTypeTypeAlias · 0.92
loadWebhookFunction · 0.85
toHookEventFunction · 0.85
validateAndUpdateWebhookFunction · 0.85
TitleMethod · 0.80
PageIsMethod · 0.80

Tested by

no test coverage detected