summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorRobert Schilling <rschilling@student.tugraz.at>2016-04-06 01:21:02 +0200
committerRobert Schilling <rschilling@student.tugraz.at>2016-04-12 14:24:05 +0200
commitba21c00f01bf4274d0e4cc3892293fc1e581b260 (patch)
tree1d9133b41f4e30b8775002c72ef78ec28d213ace /app/controllers
parent734df1bb504aedec6a5668567de808b549a84749 (diff)
downloadgitlab-ce-ba21c00f01bf4274d0e4cc3892293fc1e581b260.tar.gz
Delete notes via API
Diffstat (limited to 'app/controllers')
-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