gitlab-org--gitlab-foss/app/services/protected_branches/api_service.rb
Rémy Coutable eafe834c3d
Reduce remaining diff with EE in app/services
Signed-off-by: Rémy Coutable <remy@rymai.me>
2019-02-14 12:37:55 +01:00

17 lines
494 B
Ruby

# frozen_string_literal: true
module ProtectedBranches
class ApiService < BaseService
def create
::ProtectedBranches::CreateService.new(@project, @current_user, protected_branch_params).execute
end
def protected_branch_params
{
name: params[:name],
push_access_levels_attributes: AccessLevelParams.new(:push, params).access_levels,
merge_access_levels_attributes: AccessLevelParams.new(:merge, params).access_levels
}
end
end
end