Commit 5c253116 authored by Panagiotis Atmatzidis's avatar Panagiotis Atmatzidis Committed by Rémy Coutable

Adding 'IssueFinder' for 'projects' API endpoint

Current filtering for "/projects/:id/issues" endpoint
returns no results for "No Milestone" query.

This PR introduces fix by copying filtering from "/groups/:id/issues"
which works as expected.
parent e75b1f11
......@@ -88,12 +88,14 @@ module API
use :issues_params
end
get ":id/issues" do
issues = IssuesFinder.new(current_user,
project_id: user_project.id,
state: params[:state],
milestone_title: params[:milestone]).execute.inc_notes_with_associations
issues = filter_issues_labels(issues, params[:labels]) unless params[:labels].nil?
issues = filter_by_iid(issues, params[:iid]) unless params[:iid].nil?
project = find_project(params[:id])
params[:state] ||= 'opened'
params[:project_id] = project.id
params[:milestone_title] = params.delete(:milestone)
params[:label_name] = params.delete(:labels)
issues = IssuesFinder.new(current_user, params).execute
issues = issues.reorder(params[:order_by] => params[:sort])
present paginate(issues), with: Entities::Issue, current_user: current_user, project: user_project
......
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