(c *context.Context, orCtx *orgRepoContext, f form.NewWebhook)
| 362 | } |
| 363 | |
| 364 | func 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 | |
| 387 | func WebhooksSlackEditPost(c *context.Context, orCtx *orgRepoContext, f form.NewSlackHook) { |
| 388 | c.Title("repo.settings.update_webhook") |
nothing calls this directly
no test coverage detected