aboutsummaryrefslogtreecommitdiffstats
path: root/services/forms
diff options
context:
space:
mode:
Diffstat (limited to 'services/forms')
-rw-r--r--services/forms/repo_form.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/services/forms/repo_form.go b/services/forms/repo_form.go
index 19b5a37664..e6bd088da4 100644
--- a/services/forms/repo_form.go
+++ b/services/forms/repo_form.go
@@ -396,6 +396,20 @@ func (f *NewWechatWorkHookForm) Validate(req *http.Request, errs binding.Errors)
return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
}
+// NewPackagistHookForm form for creating packagist hook
+type NewPackagistHookForm struct {
+ Username string `binding:"Required"`
+ APIToken string `binding:"Required"`
+ PackageURL string `binding:"Required;ValidUrl"`
+ WebhookForm
+}
+
+// Validate validates the fields
+func (f *NewPackagistHookForm) Validate(req *http.Request, errs binding.Errors) binding.Errors {
+ ctx := context.GetContext(req)
+ return middleware.Validate(errs, ctx.Data, f, ctx.Locale)
+}
+
// .___
// | | ______ ________ __ ____
// | |/ ___// ___/ | \_/ __ \