Commit bcbdd2e7 authored by Sashi Kumar's avatar Sashi Kumar

Filter necessary params to PackagesFinder from API

parent c4030e8e
---
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
desc: 'Return packages with this name'
end
get ':id/packages' do
packages = ::Packages::PackagesFinder
.new(user_project, declared(params)).execute
packages = ::Packages::PackagesFinder.new(
user_project,
declared_params.slice(:order_by, :sort, :package_type, :package_name)
).execute
present paginate(packages), with: EE::API::Entities::Package, user: current_user
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