Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Fletcher <mark@gitlab.com>2017-06-02 06:41:47 +0300
committerMark Fletcher <mark@gitlab.com>2017-06-06 15:16:41 +0300
commit3c15f0eae757817b4d852be6b62abd3d73186d35 (patch)
tree04f56d1dd413f4c5b518086873be741e05d0c212 /lib/api/events.rb
parentad3e180ed3d99494414cb1b367f6b4e40ec28b87 (diff)
Accept a username for User-level Events API
Diffstat (limited to 'lib/api/events.rb')
-rw-r--r--lib/api/events.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/api/events.rb b/lib/api/events.rb
index ed5df268ae3..dabdf579119 100644
--- a/lib/api/events.rb
+++ b/lib/api/events.rb
@@ -42,7 +42,7 @@ module API
end
params do
- requires :id, type: Integer, desc: 'The ID of the user'
+ requires :id, type: String, desc: 'The ID or Username of the user'
end
resource :users do
desc 'Get the contribution events of a specified user' do
@@ -55,7 +55,7 @@ module API
use :sort_params
end
get ':id/events' do
- user = User.find_by(id: params[:id])
+ user = find_user(params[:id])
not_found!('User') unless user
events = EventsFinder.new(params.merge(source: user, current_user: current_user)).execute.preload(:author, :target)