diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-21 08:56:42 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-21 08:56:42 +0000 |
commit | 7381a33f696ca74b86a21f0b66e87be92d2efcc1 (patch) | |
tree | ee35eef65f871f91d283124c9295c9e2ff238ab0 /lib/api/issues.rb | |
parent | cf7f3606d3bca3dfb481323aaa4f3dc50ca1a089 (diff) | |
parent | d839b880a256f208ae5a0d877765bc5fcbfcd44d (diff) | |
download | gitlab-ce-7381a33f696ca74b86a21f0b66e87be92d2efcc1.tar.gz |
Merge branch '44799-api-naming-issue-scope' into 'master'
Resolve "API naming for issue scope"
Closes #44799
See merge request gitlab-org/gitlab-ce!18935
Diffstat (limited to 'lib/api/issues.rb')
-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 2f50f94c897..6d75e8817c4 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -13,6 +13,7 @@ module API args.delete(:id) args[:milestone_title] = args.delete(:milestone) args[:label_name] = args.delete(:labels) + args[:scope] = args[:scope].underscore if args[:scope] issues = IssuesFinder.new(current_user, args).execute .preload(:assignees, :labels, :notes, :timelogs) @@ -36,8 +37,8 @@ module API optional :updated_before, type: DateTime, desc: 'Return issues updated 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 issues for the given scope: `created-by-me`, `assigned-to-me` or `all`' + optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all], + desc: 'Return issues 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' use :pagination end @@ -66,8 +67,8 @@ 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 issues for the given scope: `created-by-me`, `assigned-to-me` or `all`' + optional :scope, type: String, values: %w[created-by-me assigned-to-me created_by_me assigned_to_me all], default: 'created_by_me', + desc: 'Return issues for the given scope: `created_by_me`, `assigned_to_me` or `all`' end get do authenticate! unless params[:scope] == 'all' |