diff options
author | Toon Claes <toon@iotcl.com> | 2017-07-24 22:41:33 +0200 |
---|---|---|
committer | Toon Claes <toon@iotcl.com> | 2017-07-24 22:46:02 +0200 |
commit | d8798c907dfb960856423422a91eb1e6dc8db090 (patch) | |
tree | 9ffad47b1ec49430f33a356baa3ae4e7d5da6cfb /lib/api | |
parent | 8bf89cb4aba188cd9abc41bb9eefb92458cfb75b (diff) | |
download | gitlab-ce-d8798c907dfb960856423422a91eb1e6dc8db090.tar.gz |
Allow query param scope for /issues API endpointtc-issue-api-assignee
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/issues.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 621539afeaf..8f8d622fd34 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -8,9 +8,6 @@ module API def find_issues(args = {}) args = params.merge(args) - # Do not scope to "authored" when author or assignee id is given - args.delete(:scope) if args[:author_id] || args[:assignee_id] - args.delete(:id) args[:milestone_title] = args.delete(:milestone) args[:label_name] = args.delete(:labels) @@ -34,6 +31,8 @@ module API optional :created_before, type: DateTime, desc: 'Return issues created before the specified time' optional :author_id, type: Integer, desc: 'Return issues which are authored by the user with the given ID' optional :assignee_id, type: Integer, 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 all], + desc: 'Return merge requests for the given scope: `created-by-me`, `assigned-to-me` or `all`' use :pagination end @@ -60,9 +59,11 @@ module API optional :state, type: String, values: %w[opened closed all], default: 'all', desc: 'Return opened, closed, or all issues' use :issues_params + optional :scope, type: String, values: %w[created-by-me assigned-to-me all], default: 'created-by-me', + desc: 'Return merge requests for the given scope: `created-by-me`, `assigned-to-me` or `all`' end get do - issues = find_issues(scope: 'authored') + issues = find_issues present paginate(issues), with: Entities::IssueBasic, current_user: current_user end |