summaryrefslogtreecommitdiff
path: root/lib/api/notes.rb
diff options
context:
space:
mode:
authorZ.J. van de Weg <zegerjan@gitlab.com>2016-09-16 14:30:28 +0200
committerZ.J. van de Weg <zegerjan@gitlab.com>2016-09-16 16:28:53 +0200
commitcf00fbecc544dfd2d597ae89c5ecbae1b6842932 (patch)
tree5ca8548768ad0dc32de728de3a83bbdf116c1b95 /lib/api/notes.rb
parent065341bf04958b862db9cc2891c7822a3da7f7f8 (diff)
downloadgitlab-ce-cf00fbecc544dfd2d597ae89c5ecbae1b6842932.tar.gz
Fix API notes endpoint when posting only emoji
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r--lib/api/notes.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb
index 8bfa998dc53..c5c214d4d13 100644
--- a/lib/api/notes.rb
+++ b/lib/api/notes.rb
@@ -83,12 +83,12 @@ module API
opts[:created_at] = params[:created_at]
end
- @note = ::Notes::CreateService.new(user_project, current_user, opts).execute
+ note = ::Notes::CreateService.new(user_project, current_user, opts).execute
- if @note.valid?
- present @note, with: Entities::Note
+ if note.valid?
+ present note, with: Entities::const_get(note.class.name)
else
- not_found!("Note #{@note.errors.messages}")
+ not_found!("Note #{note.errors.messages}")
end
end