summaryrefslogtreecommitdiff
path: root/app/controllers/projects/notes_controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r--app/controllers/projects/notes_controller.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/app/controllers/projects/notes_controller.rb b/app/controllers/projects/notes_controller.rb
index 1b9dd568043..a9a69573eed 100644
--- a/app/controllers/projects/notes_controller.rb
+++ b/app/controllers/projects/notes_controller.rb
@@ -39,8 +39,7 @@ class Projects::NotesController < Projects::ApplicationController
def destroy
if note.editable?
- note.destroy
- note.reset_events_cache
+ Notes::DeleteService.new(project, current_user).execute(note)
end
respond_to do |format|
@@ -73,7 +72,7 @@ class Projects::NotesController < Projects::ApplicationController
note = noteable.notes.find_by(data)
if note
- note.destroy
+ Notes::DeleteService.new(project, current_user).execute(note)
else
Notes::CreateService.new(project, current_user, note_params).execute
end