summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-03-13 18:25:25 +0000
committerDouwe Maan <douwe@gitlab.com>2017-03-13 18:25:25 +0000
commitcc4ca1f3fe2e2f7470c4fae9a9c5676bbebb18b6 (patch)
treed146fcb55dd01f9579ae1120c69056c36c3a36af /lib
parent06c3c71bb8b15e4cad43cf890012ac869248b861 (diff)
parentb55936bf0beb2b21de793e3dfc350a6ca1445db1 (diff)
downloadgitlab-ce-cc4ca1f3fe2e2f7470c4fae9a9c5676bbebb18b6.tar.gz
Merge branch '25515-delegate-single-discussion-to-new-issue' into 'master'
Create a new issue for a single discussion See merge request !8266
Diffstat (limited to 'lib')
-rw-r--r--lib/api/issues.rb10
-rw-r--r--lib/api/v3/issues.rb7
2 files changed, 4 insertions, 13 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb
index 4a9f2b26fb2..1abe8639445 100644
--- a/lib/api/issues.rb
+++ b/lib/api/issues.rb
@@ -116,8 +116,10 @@ module API
requires :title, type: String, desc: 'The title of an issue'
optional :created_at, type: DateTime,
desc: 'Date time when the issue was created. Available only for admins and project owners.'
- optional :merge_request_for_resolving_discussions, type: Integer,
+ optional :merge_request_to_resolve_discussions_of, type: Integer,
desc: 'The IID of a merge request for which to resolve discussions'
+ optional :discussion_to_resolve, type: String,
+ desc: 'The ID of a discussion to resolve, also pass `merge_request_to_resolve_discussions_of`'
use :issue_params
end
post ':id/issues' do
@@ -128,12 +130,6 @@ module API
issue_params = declared_params(include_missing: false)
- if merge_request_iid = params[:merge_request_for_resolving_discussions]
- issue_params[:merge_request_for_resolving_discussions] = MergeRequestsFinder.new(current_user, project_id: user_project.id).
- execute.
- find_by(iid: merge_request_iid)
- end
-
issue = ::Issues::CreateService.new(user_project,
current_user,
issue_params.merge(request: request, api: true)).execute
diff --git a/lib/api/v3/issues.rb b/lib/api/v3/issues.rb
index 5d7dfabfcd6..258cbfed022 100644
--- a/lib/api/v3/issues.rb
+++ b/lib/api/v3/issues.rb
@@ -139,12 +139,7 @@ module API
end
issue_params = declared_params(include_missing: false)
-
- if merge_request_iid = params[:merge_request_for_resolving_discussions]
- issue_params[:merge_request_for_resolving_discussions] = MergeRequestsFinder.new(current_user, project_id: user_project.id).
- execute.
- find_by(iid: merge_request_iid)
- end
+ issue_params = issue_params.merge(merge_request_to_resolve_discussions_of: issue_params.delete(:merge_request_for_resolving_discussions))
issue = ::Issues::CreateService.new(user_project,
current_user,