diff options
author | Unknwon <u@gogs.io> | 2015-08-27 00:30:06 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-27 00:30:06 +0800 |
commit | 4217c2333cf9ac29af611df9826cc4b5198241fe (patch) | |
tree | d388e0ede4707c902a499937a31b67faa4c784c6 /modules/auth/repo_form.go | |
parent | 28814564212b7c64136cc3eda3774af56983557e (diff) | |
download | gitea-4217c2333cf9ac29af611df9826cc4b5198241fe.tar.gz gitea-4217c2333cf9ac29af611df9826cc4b5198241fe.zip |
new create webhook UI
Diffstat (limited to 'modules/auth/repo_form.go')
-rw-r--r-- | modules/auth/repo_form.go | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/modules/auth/repo_form.go b/modules/auth/repo_form.go index cbabbb4668..a0700e821a 100644 --- a/modules/auth/repo_form.go +++ b/modules/auth/repo_form.go @@ -65,13 +65,17 @@ func (f *RepoSettingForm) Validate(ctx *macaron.Context, errs binding.Errors) bi // \__/\ / \___ >___ /___| /___| /\____/|__|_ \ // \/ \/ \/ \/ \/ \/ +type WebhookForm struct { + HookType string `binding:"Required"` + PushOnly bool + Active bool +} + type NewWebhookForm struct { - HookTaskType string `form:"hook_type" binding:"Required"` - PayloadUrl string `form:"payload_url" binding:"Required;Url"` - ContentType string `form:"content_type" binding:"Required"` - Secret string `form:"secret"` - PushOnly bool `form:"push_only"` - Active bool `form:"active"` + PayloadURL string `binding:"Required;Url"` + ContentType int `binding:"Required"` + Secret string + WebhookForm } func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { @@ -79,11 +83,9 @@ func (f *NewWebhookForm) Validate(ctx *macaron.Context, errs binding.Errors) bin } type NewSlackHookForm struct { - HookTaskType string `form:"hook_type" binding:"Required"` - PayloadUrl string `form:"payload_url" binding:"Required` - Channel string `form:"channel" binding:"Required"` - PushOnly bool `form:"push_only"` - Active bool `form:"active"` + PayloadURL string `binding:"Required` + Channel string `binding:"Required"` + WebhookForm } func (f *NewSlackHookForm) Validate(ctx *macaron.Context, errs binding.Errors) binding.Errors { |