summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2017-08-30 09:56:17 +0000
committerSean McGivern <sean@mcgivern.me.uk>2017-08-30 09:56:17 +0000
commitf11049ab9131b78c14e95bd95b3073c1eaf59392 (patch)
tree882c763637a02a386486799c39897bd563c7b6aa /lib/api/notes.rb
parenta16854ff462935f1a967f31abfeb242cf26284cc (diff)
parentee4820a5268d02fb7ed142511d1a194f06629a1e (diff)
downloadgitlab-ce-f11049ab9131b78c14e95bd95b3073c1eaf59392.tar.gz
Merge branch 'api-delete-respect-headers' into 'master'
API: Respect the 'If-Unmodified-Since' for delete endpoints See merge request !9621
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 4e4e473994b..e116448c15b 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -129,10 +129,12 @@ module API
end
delete ":id/#{noteables_str}/:noteable_id/notes/:note_id" do
note = user_project.notes.find(params[:note_id])
+
authorize! :admin_note, note
- status 204
- ::Notes::DestroyService.new(user_project, current_user).execute(note)
+ destroy_conditionally!(note) do |note|
+ ::Notes::DestroyService.new(user_project, current_user).execute(note)
+ end
end
end
end