diff options
author | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-06 02:21:02 +0300 |
---|---|---|
committer | Robert Schilling <rschilling@student.tugraz.at> | 2016-04-12 15:24:05 +0300 |
commit | ba21c00f01bf4274d0e4cc3892293fc1e581b260 (patch) | |
tree | 1d9133b41f4e30b8775002c72ef78ec28d213ace /app/controllers/projects/notes_controller.rb | |
parent | 734df1bb504aedec6a5668567de808b549a84749 (diff) |
Delete notes via API
Diffstat (limited to 'app/controllers/projects/notes_controller.rb')
-rw-r--r-- | app/controllers/projects/notes_controller.rb | 5 |
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 |