1
0
Fork 0
forked from forgejo/forgejo

[REFACTOR] webhook gogs endpoint

This commit is contained in:
oliverpool 2024-03-21 14:09:49 +01:00
parent dce754cde1
commit 4ab341e971
4 changed files with 27 additions and 44 deletions

View file

@ -278,20 +278,6 @@ func (f WebhookForm) ChooseEvents() bool {
return f.Events == "choose_events"
}
// NewGogshookForm form for creating gogs hook
type NewGogshookForm struct {
PayloadURL string `binding:"Required;ValidUrl"`
ContentType int `binding:"Required"`
Secret string
WebhookForm
}
// Validate validates the fields
func (f *NewGogshookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
ctx := context.GetValidateContext(req)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
// .___
// | | ______ ________ __ ____
// | |/ ___// ___/ | \_/ __ \