Skip to content
Snippets Groups Projects
Commit 270a4337 authored by Nihad Abbasov's avatar Nihad Abbasov
Browse files

API: get a single wall note

parent b17e94c3
No related branches found
No related tags found
1 merge request!2124remove unnecessary API::VERSION constant
Loading
Loading
@@ -57,6 +57,19 @@ Parameters:
 
## Single note
 
### Single wall note
Get a wall note.
```
GET /projects/:id/notes/:note_id
```
Parameters:
+ `id` (required) - The ID or code name of a project
+ `note_id` (required) - The ID of a wall note
### Single issue note
 
Get an issue note.
Loading
Loading
Loading
Loading
@@ -17,6 +17,18 @@ module Gitlab
present paginate(@notes), with: Entities::Note
end
 
# Get a single project wall note
#
# Parameters:
# id (required) - The ID or code name of a project
# note_id (required) - The ID of a note
# Example Request:
# GET /projects/:id/notes/:note_id
get ":id/notes/:note_id" do
@note = user_project.common_notes.find(params[:note_id])
present @note, with: Entities::Note
end
# Create a new project wall note
#
# Parameters:
Loading
Loading
Loading
Loading
@@ -30,6 +30,14 @@ describe Gitlab::API do
end
end
 
describe "GET /projects/:id/notes/:note_id" do
it "should return a wall note by id" do
get api("/projects/#{project.id}/notes/#{wall_note.id}", user)
response.status.should == 200
json_response['body'].should == wall_note.note
end
end
describe "POST /projects/:id/notes" do
it "should create a new wall note" do
post api("/projects/#{project.id}/notes", user), body: 'hi!'
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment