diff options
Diffstat (limited to 'routers/repo/webhook.go')
-rw-r--r-- | routers/repo/webhook.go | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/routers/repo/webhook.go b/routers/repo/webhook.go index 7ff110edba..fe16d249eb 100644 --- a/routers/repo/webhook.go +++ b/routers/repo/webhook.go @@ -16,12 +16,12 @@ import ( "code.gitea.io/gitea/modules/base" "code.gitea.io/gitea/modules/context" "code.gitea.io/gitea/modules/convert" - auth "code.gitea.io/gitea/modules/forms" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/setting" api "code.gitea.io/gitea/modules/structs" "code.gitea.io/gitea/modules/util" "code.gitea.io/gitea/modules/web" + "code.gitea.io/gitea/services/forms" "code.gitea.io/gitea/services/webhook" jsoniter "github.com/json-iterator/go" ) @@ -153,7 +153,7 @@ func WebhooksNew(ctx *context.Context) { } // ParseHookEvent convert web form content to models.HookEvent -func ParseHookEvent(form auth.WebhookForm) *models.HookEvent { +func ParseHookEvent(form forms.WebhookForm) *models.HookEvent { return &models.HookEvent{ PushOnly: form.PushOnly(), SendEverything: form.SendEverything(), @@ -184,7 +184,7 @@ func ParseHookEvent(form auth.WebhookForm) *models.HookEvent { // GiteaHooksNewPost response for creating Gitea webhook func GiteaHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewWebhookForm) + form := web.GetForm(ctx).(*forms.NewWebhookForm) ctx.Data["Title"] = ctx.Tr("repo.settings.add_webhook") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -234,12 +234,12 @@ func GiteaHooksNewPost(ctx *context.Context) { // GogsHooksNewPost response for creating webhook func GogsHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewGogshookForm) + form := web.GetForm(ctx).(*forms.NewGogshookForm) newGogsWebhookPost(ctx, *form, models.GOGS) } // newGogsWebhookPost response for creating gogs hook -func newGogsWebhookPost(ctx *context.Context, form auth.NewGogshookForm, kind models.HookTaskType) { +func newGogsWebhookPost(ctx *context.Context, form forms.NewGogshookForm, kind models.HookTaskType) { ctx.Data["Title"] = ctx.Tr("repo.settings.add_webhook") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -288,7 +288,7 @@ func newGogsWebhookPost(ctx *context.Context, form auth.NewGogshookForm, kind mo // DiscordHooksNewPost response for creating discord hook func DiscordHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewDiscordHookForm) + form := web.GetForm(ctx).(*forms.NewDiscordHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -341,7 +341,7 @@ func DiscordHooksNewPost(ctx *context.Context) { // DingtalkHooksNewPost response for creating dingtalk hook func DingtalkHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewDingtalkHookForm) + form := web.GetForm(ctx).(*forms.NewDingtalkHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -384,7 +384,7 @@ func DingtalkHooksNewPost(ctx *context.Context) { // TelegramHooksNewPost response for creating telegram hook func TelegramHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewTelegramHookForm) + form := web.GetForm(ctx).(*forms.NewTelegramHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -437,7 +437,7 @@ func TelegramHooksNewPost(ctx *context.Context) { // MatrixHooksNewPost response for creating a Matrix hook func MatrixHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewMatrixHookForm) + form := web.GetForm(ctx).(*forms.NewMatrixHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -493,7 +493,7 @@ func MatrixHooksNewPost(ctx *context.Context) { // MSTeamsHooksNewPost response for creating MS Teams hook func MSTeamsHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewMSTeamsHookForm) + form := web.GetForm(ctx).(*forms.NewMSTeamsHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -536,7 +536,7 @@ func MSTeamsHooksNewPost(ctx *context.Context) { // SlackHooksNewPost response for creating slack hook func SlackHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewSlackHookForm) + form := web.GetForm(ctx).(*forms.NewSlackHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -597,7 +597,7 @@ func SlackHooksNewPost(ctx *context.Context) { // FeishuHooksNewPost response for creating feishu hook func FeishuHooksNewPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewFeishuHookForm) + form := web.GetForm(ctx).(*forms.NewFeishuHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksNew"] = true @@ -701,7 +701,7 @@ func WebHooksEdit(ctx *context.Context) { // WebHooksEditPost response for editing web hook func WebHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewWebhookForm) + form := web.GetForm(ctx).(*forms.NewWebhookForm) ctx.Data["Title"] = ctx.Tr("repo.settings.update_webhook") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -742,7 +742,7 @@ func WebHooksEditPost(ctx *context.Context) { // GogsHooksEditPost response for editing gogs hook func GogsHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewGogshookForm) + form := web.GetForm(ctx).(*forms.NewGogshookForm) ctx.Data["Title"] = ctx.Tr("repo.settings.update_webhook") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -782,7 +782,7 @@ func GogsHooksEditPost(ctx *context.Context) { // SlackHooksEditPost response for editing slack hook func SlackHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewSlackHookForm) + form := web.GetForm(ctx).(*forms.NewSlackHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -834,7 +834,7 @@ func SlackHooksEditPost(ctx *context.Context) { // DiscordHooksEditPost response for editing discord hook func DiscordHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewDiscordHookForm) + form := web.GetForm(ctx).(*forms.NewDiscordHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -878,7 +878,7 @@ func DiscordHooksEditPost(ctx *context.Context) { // DingtalkHooksEditPost response for editing discord hook func DingtalkHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewDingtalkHookForm) + form := web.GetForm(ctx).(*forms.NewDingtalkHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -911,7 +911,7 @@ func DingtalkHooksEditPost(ctx *context.Context) { // TelegramHooksEditPost response for editing discord hook func TelegramHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewTelegramHookForm) + form := web.GetForm(ctx).(*forms.NewTelegramHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -953,7 +953,7 @@ func TelegramHooksEditPost(ctx *context.Context) { // MatrixHooksEditPost response for editing a Matrix hook func MatrixHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewMatrixHookForm) + form := web.GetForm(ctx).(*forms.NewMatrixHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -998,7 +998,7 @@ func MatrixHooksEditPost(ctx *context.Context) { // MSTeamsHooksEditPost response for editing MS Teams hook func MSTeamsHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewMSTeamsHookForm) + form := web.GetForm(ctx).(*forms.NewMSTeamsHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true @@ -1031,7 +1031,7 @@ func MSTeamsHooksEditPost(ctx *context.Context) { // FeishuHooksEditPost response for editing feishu hook func FeishuHooksEditPost(ctx *context.Context) { - form := web.GetForm(ctx).(*auth.NewFeishuHookForm) + form := web.GetForm(ctx).(*forms.NewFeishuHookForm) ctx.Data["Title"] = ctx.Tr("repo.settings") ctx.Data["PageIsSettingsHooks"] = true ctx.Data["PageIsSettingsHooksEdit"] = true |