diff options
author | haseeb <haseebeqx@yahoo.com> | 2017-08-10 23:05:20 +0530 |
---|---|---|
committer | haseeb <haseebeqx@yahoo.com> | 2017-08-10 23:05:20 +0530 |
commit | a115267e25f8f2499156ea04bf1d9c0296b09270 (patch) | |
tree | a6c3a6eca310319d7519686f2958b055f6b7cebb /app | |
parent | f6d75f091733aa94dcfe011c374d885be4ad6c11 (diff) | |
download | gitlab-ce-a115267e25f8f2499156ea04bf1d9c0296b09270.tar.gz |
working version of create merge requests with labels
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/projects/issues_controller.rb | 12 | ||||
-rw-r--r-- | app/services/merge_requests/create_from_issue_service.rb | 4 |
2 files changed, 12 insertions, 4 deletions
diff --git a/app/controllers/projects/issues_controller.rb b/app/controllers/projects/issues_controller.rb index 8893a514207..04c14806544 100644 --- a/app/controllers/projects/issues_controller.rb +++ b/app/controllers/projects/issues_controller.rb @@ -212,7 +212,7 @@ class Projects::IssuesController < Projects::ApplicationController end def create_merge_request - result = ::MergeRequests::CreateFromIssueService.new(project, current_user, issue_iid: issue.iid).execute + result = ::MergeRequests::CreateFromIssueService.new(project, current_user, merge_request_params).execute if result[:status] == :success render json: MergeRequestCreateSerializer.new.represent(result[:merge_request]) @@ -287,4 +287,14 @@ class Projects::IssuesController < Projects::ApplicationController redirect_to new_user_session_path, notice: notice end + + private + + def merge_request_params + { + issue_iid: issue.iid, + label_ids: issue.label_ids, + milestone_id: issue.milestone_id + } + end end diff --git a/app/services/merge_requests/create_from_issue_service.rb b/app/services/merge_requests/create_from_issue_service.rb index aec68c74aa6..738cedbaed7 100644 --- a/app/services/merge_requests/create_from_issue_service.rb +++ b/app/services/merge_requests/create_from_issue_service.rb @@ -43,9 +43,7 @@ module MergeRequests { source_project_id: project.id, source_branch: branch_name, - target_project_id: project.id, - labels: issue.labels, - milestone_id: issue.milestone_id + target_project_id: project.id } end |