mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
ADD protected branch Features
This commit is contained in:
22
app/services/protected_branches/create_service.rb
Normal file
22
app/services/protected_branches/create_service.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
module ProtectedBranches
|
||||
class CreateService < ProtectedBranches::BaseService
|
||||
def call
|
||||
validate!
|
||||
|
||||
save_gitea_protected_branch!
|
||||
|
||||
save_protected_branch!
|
||||
|
||||
protected_branch
|
||||
end
|
||||
|
||||
private
|
||||
def protected_branch
|
||||
@protected_branch ||= repository.protected_branches.new(protected_branch_params)
|
||||
end
|
||||
|
||||
def save_protected_branch!
|
||||
protected_branch.save
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user