diff options
Diffstat (limited to 'lib/api/protected_branches.rb')
-rw-r--r-- | lib/api/protected_branches.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/api/protected_branches.rb b/lib/api/protected_branches.rb index c7665c20234..1fd86d1e720 100644 --- a/lib/api/protected_branches.rb +++ b/lib/api/protected_branches.rb @@ -19,10 +19,15 @@ module API end params do use :pagination + optional :search, type: String, desc: 'Search for a protected branch by name' end # rubocop: disable CodeReuse/ActiveRecord get ':id/protected_branches' do - protected_branches = user_project.protected_branches.preload(:push_access_levels, :merge_access_levels) + protected_branches = + ProtectedBranchesFinder + .new(user_project, params) + .execute + .preload(:push_access_levels, :merge_access_levels) present paginate(protected_branches), with: Entities::ProtectedBranch, project: user_project end |