mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
add: repository create webhook
This commit is contained in:
8
app/forms/projects/webhooks/create_form.rb
Normal file
8
app/forms/projects/webhooks/create_form.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class Projects::Webhooks::CreateForm < BaseForm
|
||||
attr_accessor :type, :url, :http_method, :content_type, :secret, :events, :active, :branch_filter
|
||||
|
||||
validates :url, format: { with: URI::regexp(%w[http https]), message: "请输入正确的地址" }
|
||||
validates :active, inclusion: {in: [true, false]}
|
||||
validates :http_method, inclusion: { in: %w(POST GET), message: "请输入正确的请求方式"}
|
||||
validates :content_type, inclusion: { in: %w(json form), message: "请输入正确的Content Type"}
|
||||
end
|
||||
Reference in New Issue
Block a user