diff options
author | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-06 19:34:06 +0400 |
---|---|---|
committer | Sebastian Ziebell <sebastian.ziebell@asquera.de> | 2013-02-06 20:11:00 +0400 |
commit | bb24275f8d0e726aec347c8be7f199346e90793d (patch) | |
tree | 3fc4a01ad41fb2916c23f1465f8305826e7934c8 /lib/api/notes.rb | |
parent | b9d40d2524a78013737be16b4cd0976ded843a1b (diff) |
Status code 400 is returned if body is missing on note creation.
If a note is created with a POST request via API (`/projects/:id/notes`) status
code 400 is returned instead of 404. The resource itself exists but the request
is incomplete. Specs added to check different status codes when accessing, creating
and updating notes.
Diffstat (limited to 'lib/api/notes.rb')
-rw-r--r-- | lib/api/notes.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 4613db54578..75ea238fe23 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -43,6 +43,8 @@ module Gitlab if @note.save present @note, with: Entities::Note else + # :note is exposed as :body, but :note is set on error + error!(@note.errors[:note], 400) if @note.errors[:note].any? not_found! end end |