Skip to content
Snippets Groups Projects
Commit 09330dd1 authored by Douwe Maan's avatar Douwe Maan
Browse files

Remove unused code

parent 00855926
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -28,8 +28,7 @@ class Projects::NotesController < Projects::ApplicationController
def create
create_params = note_params.merge(
merge_request_diff_head_sha: params[:merge_request_diff_head_sha],
in_reply_to_discussion_id: params[:in_reply_to_discussion_id],
new_discussion: params[:new_discussion],
in_reply_to_discussion_id: params[:in_reply_to_discussion_id]
)
@note = Notes::CreateService.new(project, current_user, create_params).execute
 
Loading
Loading
Loading
Loading
@@ -2,7 +2,6 @@ module Notes
class BuildService < ::BaseService
def execute
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?
discussion = project.notes.find_discussion(in_reply_to_discussion_id)
Loading
Loading
@@ -14,9 +13,6 @@ module Notes
end
 
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
 
note = Note.new(params)
Loading
Loading
Loading
Loading
@@ -153,8 +153,7 @@ describe Projects::NotesController do
noteable_id: merge_request.id.to_s,
noteable_type: 'MergeRequest',
merge_request_diff_head_sha: 'sha',
in_reply_to_discussion_id: nil,
new_discussion: nil
in_reply_to_discussion_id: nil
}
 
expect(Notes::CreateService).to receive(:new).with(project, user, service_params).and_return(double(execute: true))
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment