Commit 806839fe authored by Mayra Cabrera's avatar Mayra Cabrera

Merge branch 'sk/project-packages-api-filter-necessary-params' into 'master'

Filter necessary params to PackagesFinder from API

See merge request gitlab-org/gitlab!29052
parents 8d17d7c3 bcbdd2e7
---
title: Refactor projects/:id/packages API to supply only necessary params to PackagesFinder
merge_request: 29052
author: Sashi Kumar
type: other
...@@ -30,8 +30,10 @@ module API ...@@ -30,8 +30,10 @@ module API
desc: 'Return packages with this name' desc: 'Return packages with this name'
end end
get ':id/packages' do get ':id/packages' do
packages = ::Packages::PackagesFinder packages = ::Packages::PackagesFinder.new(
.new(user_project, declared(params)).execute user_project,
declared_params.slice(:order_by, :sort, :package_type, :package_name)
).execute
present paginate(packages), with: EE::API::Entities::Package, user: current_user present paginate(packages), with: EE::API::Entities::Package, user: current_user
end end
......
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