summaryrefslogtreecommitdiff
path: root/lib/api/merge_requests.rb
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-11-22 08:23:43 +0100
committerRobert Schilling <rschilling@student.tugraz.at>2016-11-22 08:25:07 +0100
commitcb11d3521ce99a5ce796e2fdf9e6d96a3e36791d (patch)
tree71f5ae5f9cf1f283b865d1240c5c50a7e05787ad /lib/api/merge_requests.rb
parent35d6ea4f5ee7605a7f4e4c44cc4b79a40aec9418 (diff)
downloadgitlab-ce-cb11d3521ce99a5ce796e2fdf9e6d96a3e36791d.tar.gz
Fix IID filter for merge requests and milestones
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r--lib/api/merge_requests.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb
index 4176c7eec06..009913c6242 100644
--- a/lib/api/merge_requests.rb
+++ b/lib/api/merge_requests.rb
@@ -41,15 +41,13 @@ module API
desc: 'Return merge requests ordered by `created_at` or `updated_at` fields.'
optional :sort, type: String, values: %w[asc desc], default: 'desc',
desc: 'Return merge requests sorted in `asc` or `desc` order.'
- optional :iid, type: Integer, desc: 'The IID of the merge requests'
+ optional :iid, type: Array[Integer], desc: 'The IID of the merge requests'
end
get ":id/merge_requests" do
authorize! :read_merge_request, user_project
- merge_requests = user_project.merge_requests.inc_notes_with_associations
- unless params[:iid].nil?
- merge_requests = filter_by_iid(merge_requests, params[:iid])
- end
+ merge_requests = user_project.merge_requests.inc_notes_with_associations
+ merge_requests = filter_by_iid(merge_requests, params[:iid]) if params[:iid].present?
merge_requests =
case params[:state]