diff options
author | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-25 17:19:12 +0800 |
---|---|---|
committer | Heinrich Lee Yu <hleeyu@gmail.com> | 2018-10-26 10:32:14 +0800 |
commit | 006631f8823c1dfe43cc7b9ed7e47a11a3d3809c (patch) | |
tree | fea83c67443dd8b0217d287c2b5ca4295e074c7c /lib | |
parent | 227e30f7feb2072407a231a762835bf8d5103129 (diff) | |
download | gitlab-ce-006631f8823c1dfe43cc7b9ed7e47a11a3d3809c.tar.gz |
Apply similar change to MRs API
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/issues.rb | 2 | ||||
-rw-r--r-- | lib/api/merge_requests.rb | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 89232212bc7..d863a37238c 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -42,7 +42,7 @@ module API optional :author_id, type: Integer, desc: 'Return issues which are authored by the user with the given ID' optional :assignee_id, types: [Integer, String], values: -> (v) { - v.is_a?(Integer) or [IssuableFinder::FILTER_NONE, IssuableFinder::FILTER_ANY].include?(v) + v.is_a?(Integer) || [IssuableFinder::FILTER_NONE, IssuableFinder::FILTER_ANY].include?(v) }, desc: 'Return issues which are assigned to the user with the given ID' optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all], diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 440d94ae186..5f209228105 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -89,7 +89,11 @@ module API optional :updated_before, type: DateTime, desc: 'Return merge requests updated before the specified time' optional :view, type: String, values: %w[simple], desc: 'If simple, returns the `iid`, URL, title, description, and basic state of merge request' optional :author_id, type: Integer, desc: 'Return merge requests which are authored by the user with the given ID' - optional :assignee_id, type: Integer, desc: 'Return merge requests which are assigned to the user with the given ID' + optional :assignee_id, types: [Integer, String], + values: -> (v) { + v.is_a?(Integer) || [IssuableFinder::FILTER_NONE, IssuableFinder::FILTER_ANY].include?(v) + }, + desc: 'Return merge requests which are assigned to the user with the given ID' optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all], desc: 'Return merge requests for the given scope: `created_by_me`, `assigned_to_me` or `all`' optional :my_reaction_emoji, type: String, desc: 'Return issues reacted by the authenticated user by the given emoji' |