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 ...@@ -11,7 +11,7 @@ module EE
super super
rescue ::EE::ProtectedBranches::ApiService::GroupsNotAccessibleError, rescue ::EE::ProtectedBranches::ApiService::GroupsNotAccessibleError,
::EE::ProtectedBranches::ApiService::UsersNotAccessibleError ::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' message = 'Cannot add users or groups unless they have access to the project'
protected_branch.errors.add(:base, message) protected_branch.errors.add(:base, message)
end end
......
...@@ -62,7 +62,8 @@ module API ...@@ -62,7 +62,8 @@ module API
conflict!("Protected branch '#{params[:name]}' already exists") conflict!("Protected branch '#{params[:name]}' already exists")
end 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 protected_branch = api_service.create
if protected_branch.persisted? 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