mirror of
https://github.com/go-gitea/gitea
synced 2025-07-24 11:18:36 +00:00
Add golangci (#6418)
This commit is contained in:
@@ -197,12 +197,20 @@ func WebHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
}
|
||||
|
||||
// GogsHooksNewPost response for creating webhook
|
||||
func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
|
||||
func GogsHooksNewPost(ctx *context.Context, form auth.NewWebhookForm) {
|
||||
newGenericWebhookPost(ctx, form, models.GOGS)
|
||||
}
|
||||
|
||||
func newGenericWebhookPost(ctx *context.Context, form auth.NewWebhookForm, kind models.HookTaskType) {
|
||||
ctx.Data["Title"] = ctx.Tr("repo.settings.add_webhook")
|
||||
ctx.Data["PageIsSettingsHooks"] = true
|
||||
ctx.Data["PageIsSettingsHooksNew"] = true
|
||||
ctx.Data["Webhook"] = models.Webhook{HookEvent: &models.HookEvent{}}
|
||||
ctx.Data["HookType"] = "gogs"
|
||||
|
||||
ctx.Data["HookType"] = "gitea"
|
||||
if kind == models.GOGS {
|
||||
ctx.Data["HookType"] = "gogs"
|
||||
}
|
||||
|
||||
orCtx, err := getOrgRepoCtx(ctx)
|
||||
if err != nil {
|
||||
@@ -228,7 +236,7 @@ func GogsHooksNewPost(ctx *context.Context, form auth.NewGogshookForm) {
|
||||
Secret: form.Secret,
|
||||
HookEvent: ParseHookEvent(form.WebhookForm),
|
||||
IsActive: form.Active,
|
||||
HookTaskType: models.GOGS,
|
||||
HookTaskType: kind,
|
||||
OrgID: orCtx.OrgID,
|
||||
}
|
||||
if err := w.UpdateEvent(); err != nil {
|
||||
|
Reference in New Issue
Block a user