diff options
author | Rémy Coutable <remy@rymai.me> | 2016-11-22 19:16:43 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2016-11-22 19:16:43 +0300 |
commit | 7902395f1f97f5adcb89491b7ff18c05d99e8fe0 (patch) | |
tree | f5ce11f4910097a76130065f542f8ca02be088d4 /lib/api/merge_requests.rb | |
parent | 26ec4b97bda157b3c2b9cdd87d426e9e576148a6 (diff) | |
parent | 22d16ccdb59b1604fd71ce5c8469ee7217bed693 (diff) |
Merge branch 'fix-api-iid-filter' into 'master'
Fix IID filter for merge requests and milestones
I updated the example in the docs and added a test. The milestones API was also broken for the same reason.
Related to !7358 and !7373
See merge request !7648
Diffstat (limited to 'lib/api/merge_requests.rb')
-rw-r--r-- | lib/api/merge_requests.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 15488b33f31..e82651a1578 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] |