Commit 09330dd1 authored by Douwe Maan's avatar Douwe Maan

Remove unused code

parent 00855926
...@@ -28,8 +28,7 @@ class Projects::NotesController < Projects::ApplicationController ...@@ -28,8 +28,7 @@ class Projects::NotesController < Projects::ApplicationController
def create def create
create_params = note_params.merge( create_params = note_params.merge(
merge_request_diff_head_sha: params[:merge_request_diff_head_sha], merge_request_diff_head_sha: params[:merge_request_diff_head_sha],
in_reply_to_discussion_id: params[:in_reply_to_discussion_id], in_reply_to_discussion_id: params[:in_reply_to_discussion_id]
new_discussion: params[:new_discussion],
) )
@note = Notes::CreateService.new(project, current_user, create_params).execute @note = Notes::CreateService.new(project, current_user, create_params).execute
......
...@@ -2,7 +2,6 @@ module Notes ...@@ -2,7 +2,6 @@ module Notes
class BuildService < ::BaseService class BuildService < ::BaseService
def execute def execute
in_reply_to_discussion_id = params.delete(:in_reply_to_discussion_id) in_reply_to_discussion_id = params.delete(:in_reply_to_discussion_id)
new_discussion = params.delete(:new_discussion)
if project && in_reply_to_discussion_id.present? if project && in_reply_to_discussion_id.present?
discussion = project.notes.find_discussion(in_reply_to_discussion_id) discussion = project.notes.find_discussion(in_reply_to_discussion_id)
...@@ -14,9 +13,6 @@ module Notes ...@@ -14,9 +13,6 @@ module Notes
end end
params.merge!(discussion.reply_attributes) params.merge!(discussion.reply_attributes)
elsif new_discussion
# TODO: Remove when we use a selectbox instead of a submit button
params[:type] = DiscussionNote.name
end end
note = Note.new(params) note = Note.new(params)
......
...@@ -153,8 +153,7 @@ describe Projects::NotesController do ...@@ -153,8 +153,7 @@ describe Projects::NotesController do
noteable_id: merge_request.id.to_s, noteable_id: merge_request.id.to_s,
noteable_type: 'MergeRequest', noteable_type: 'MergeRequest',
merge_request_diff_head_sha: 'sha', merge_request_diff_head_sha: 'sha',
in_reply_to_discussion_id: nil, in_reply_to_discussion_id: nil
new_discussion: nil
} }
expect(Notes::CreateService).to receive(:new).with(project, user, service_params).and_return(double(execute: true)) expect(Notes::CreateService).to receive(:new).with(project, user, service_params).and_return(double(execute: true))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment