Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
270a4337
Commit
270a4337
authored
Dec 01, 2012
by
Nihad Abbasov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
API: get a single wall note
parent
b17e94c3
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
0 deletions
+33
-0
doc/api/notes.md
doc/api/notes.md
+13
-0
lib/api/notes.rb
lib/api/notes.rb
+12
-0
spec/requests/api/notes_spec.rb
spec/requests/api/notes_spec.rb
+8
-0
No files found.
doc/api/notes.md
View file @
270a4337
...
@@ -57,6 +57,19 @@ Parameters:
...
@@ -57,6 +57,19 @@ Parameters:
## Single note
## 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
### Single issue note
Get an issue note.
Get an issue note.
...
...
lib/api/notes.rb
View file @
270a4337
...
@@ -17,6 +17,18 @@ module Gitlab
...
@@ -17,6 +17,18 @@ module Gitlab
present
paginate
(
@notes
),
with:
Entities
::
Note
present
paginate
(
@notes
),
with:
Entities
::
Note
end
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
# Create a new project wall note
#
#
# Parameters:
# Parameters:
...
...
spec/requests/api/notes_spec.rb
View file @
270a4337
...
@@ -30,6 +30,14 @@ describe Gitlab::API do
...
@@ -30,6 +30,14 @@ describe Gitlab::API do
end
end
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
describe
"POST /projects/:id/notes"
do
it
"should create a new wall note"
do
it
"should create a new wall note"
do
post
api
(
"/projects/
#{
project
.
id
}
/notes"
,
user
),
body:
'hi!'
post
api
(
"/projects/
#{
project
.
id
}
/notes"
,
user
),
body:
'hi!'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment