diff options
author | Bob Van Landuyt <bob@vanlanduyt.co> | 2017-02-27 10:23:36 +0100 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-03-13 08:27:51 +0100 |
commit | f86928953d2d79f40f10813a6e244c1da0779d16 (patch) | |
tree | 7396889bce42589175ec3c2fa314fdf621ef73b1 /lib/api | |
parent | 51253b2dd0bb073d271ddcbd172f7c204d4639db (diff) | |
download | gitlab-ce-f86928953d2d79f40f10813a6e244c1da0779d16.tar.gz |
Always require MR-iid for resolving discussions
And deduplicate the finding of MR's & discussions. Now the searching
is done in the service, istead of the controller & the API.
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/issues.rb | 13 |
1 files changed, 1 insertions, 12 deletions
diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 9aac3c8fe1a..162e13a313d 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -119,7 +119,7 @@ module API optional :merge_request_for_resolving_discussions, 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' + desc: 'The ID of a discussion to resolve, also pass `merge_request_for_resolving_discussions`' use :issue_params end post ':id/issues' do @@ -130,17 +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 - - if discussion_id = params[:discussion_to_resolve] - issue_params[:discussion_to_resolve] = NotesFinder.new(user_project, current_user, discussion_id: discussion_id). - first_discussion - end - issue = ::Issues::CreateService.new(user_project, current_user, issue_params.merge(request: request, api: true)).execute |