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
Boxiang Sun
gitlab-ce
Commits
ef9f8677
Commit
ef9f8677
authored
Oct 31, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose author username in project events API
Signed-off-by:
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
parent
80059cb5
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
doc/api/projects.md
doc/api/projects.md
+3
-0
lib/api/entities.rb
lib/api/entities.rb
+6
-0
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+1
-0
No files found.
doc/api/projects.md
View file @
ef9f8677
...
...
@@ -186,6 +186,7 @@ Parameters:
"target_id"
:
830
,
"target_type"
:
"Issue"
,
"author_id"
:
1
,
"author_username"
:
"john"
,
"data"
:
null
,
"target_title"
:
"Public project search field"
},
...
...
@@ -196,6 +197,7 @@ Parameters:
"target_id"
:
null
,
"target_type"
:
null
,
"author_id"
:
1
,
"author_username"
:
"john"
,
"data"
:
{
"before"
:
"50d4420237a9de7be1304607147aec22e4a14af7"
,
"after"
:
"c5feabde2d8cd023215af4d2ceeb7a64839fc428"
,
...
...
@@ -231,6 +233,7 @@ Parameters:
"target_id"
:
840
,
"target_type"
:
"Issue"
,
"author_id"
:
1
,
"author_username"
:
"john"
,
"data"
:
null
,
"target_title"
:
"Finish & merge Code search PR"
}
...
...
lib/api/entities.rb
View file @
ef9f8677
...
...
@@ -183,6 +183,12 @@ module API
expose
:target_id
,
:target_type
,
:author_id
expose
:data
,
:target_title
expose
:created_at
expose
:author_username
do
|
event
,
options
|
if
event
.
author
event
.
author
.
username
end
end
end
class
Namespace
<
Grape
::
Entity
...
...
spec/requests/api/projects_spec.rb
View file @
ef9f8677
...
...
@@ -339,6 +339,7 @@ describe API::API, api: true do
json_event
[
'action_name'
].
should
==
'joined'
json_event
[
'project_id'
].
to_i
.
should
==
project
.
id
json_event
[
'author_username'
].
should
==
user
.
username
end
it
"should return a 404 error if not found"
do
...
...
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