Commit 5373480e authored by James Edwards-Jones's avatar James Edwards-Jones

ProtectedBranch API omits empty declared params

parent e9903338
......@@ -11,7 +11,7 @@ module EE
super
rescue ::EE::ProtectedBranches::ApiService::GroupsNotAccessibleError,
::EE::ProtectedBranches::ApiService::UsersNotAccessibleError
ProtectedBranch.new.tap do |protected_branch|
::ProtectedBranch.new.tap do |protected_branch|
message = 'Cannot add users or groups unless they have access to the project'
protected_branch.errors.add(:base, message)
end
......
......@@ -62,7 +62,8 @@ module API
conflict!("Protected branch '#{params[:name]}' already exists")
end
api_service = ::ProtectedBranches::ApiService.new(user_project, current_user, declared(params))
declared_params = declared_params(include_missing: false)
api_service = ::ProtectedBranches::ApiService.new(user_project, current_user, declared_params)
protected_branch = api_service.create
if protected_branch.persisted?
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment