Commit 22e9202c authored by Victor Zagorodny's avatar Victor Zagorodny

Remove extra :project param from finder helper

parent 40e7e5a2
......@@ -32,9 +32,9 @@ module API
# TODO: rename to vulnerability_findings_by https://gitlab.com/gitlab-org/gitlab/issues/32963
def vulnerability_occurrences_by(params)
pipeline = if params[:pipeline_id]
params[:project].all_pipelines.find_by(id: params[:pipeline_id]) # rubocop:disable CodeReuse/ActiveRecord
user_project.all_pipelines.find_by(id: params[:pipeline_id]) # rubocop:disable CodeReuse/ActiveRecord
else
params[:project].latest_pipeline_with_security_reports
user_project.latest_pipeline_with_security_reports
end
return [] unless pipeline
......@@ -47,7 +47,7 @@ module API
vulnerability_occurrences = paginate(
Kaminari.paginate_array(
vulnerability_occurrences_by(declared_params.merge(project: user_project))
vulnerability_occurrences_by(declared_params)
)
)
......
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