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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
95f8f7c7
Commit
95f8f7c7
authored
Aug 12, 2015
by
Ben Boeckel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
api: add 'system', 'upvote', and 'downvote' fields to note queries
This reverts commit
4c586dc7
.
parent
cd579cb2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
2 deletions
+15
-2
app/models/note.rb
app/models/note.rb
+4
-0
doc/api/notes.md
doc/api/notes.md
+8
-2
lib/api/entities.rb
lib/api/entities.rb
+3
-0
No files found.
app/models/note.rb
View file @
95f8f7c7
...
...
@@ -360,6 +360,10 @@ class Note < ActiveRecord::Base
create_new_cross_references!
(
project
,
author
)
end
def
system?
read_attribute
(
:system
)
end
def
editable?
!
read_attribute
(
:system
)
end
...
...
doc/api/notes.md
View file @
95f8f7c7
...
...
@@ -31,7 +31,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:22:45Z"
"created_at"
:
"2013-10-02T09:22:45Z"
,
"system"
:
true
,
"upvote"
:
false
,
"downvote"
:
false
},
{
"id"
:
305
,
...
...
@@ -45,7 +48,10 @@ Parameters:
"state"
:
"active"
,
"created_at"
:
"2013-09-30T13:46:01Z"
},
"created_at"
:
"2013-10-02T09:56:03Z"
"created_at"
:
"2013-10-02T09:56:03Z"
,
"system"
:
false
,
"upvote"
:
false
,
"downvote"
:
false
}
]
```
...
...
lib/api/entities.rb
View file @
95f8f7c7
...
...
@@ -205,6 +205,9 @@ module API
expose
:attachment_identifier
,
as: :attachment
expose
:author
,
using:
Entities
::
UserBasic
expose
:created_at
expose
:system?
,
as: :system
expose
:upvote?
,
as: :upvote
expose
:downvote?
,
as: :downvote
end
class
MRNote
<
Grape
::
Entity
...
...
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