diff options
author | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-16 15:30:28 +0300 |
---|---|---|
committer | Z.J. van de Weg <zegerjan@gitlab.com> | 2016-09-16 17:28:53 +0300 |
commit | cf00fbecc544dfd2d597ae89c5ecbae1b6842932 (patch) | |
tree | 5ca8548768ad0dc32de728de3a83bbdf116c1b95 /lib | |
parent | 065341bf04958b862db9cc2891c7822a3da7f7f8 (diff) |
Fix API notes endpoint when posting only emoji
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/notes.rb | 8 |
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 |