diff options
Diffstat (limited to 'lib/api')
-rw-r--r-- | lib/api/entities.rb | 5 | ||||
-rw-r--r-- | lib/api/issues.rb | 2 | ||||
-rw-r--r-- | lib/api/users.rb | 18 |
3 files changed, 24 insertions, 1 deletions
diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 9919762cd82..939cedc1b27 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -18,6 +18,11 @@ module API expose :bio, :location, :skype, :linkedin, :twitter, :website_url, :organization end + class UserActivity < Grape::Entity + expose :username + expose :last_activity_at + end + class Identity < Grape::Entity expose :provider, :extern_uid end diff --git a/lib/api/issues.rb b/lib/api/issues.rb index 05423c17449..244725bb292 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -35,7 +35,7 @@ module API optional :assignee_id, type: Integer, desc: 'The ID of a user to assign issue' optional :milestone_id, type: Integer, desc: 'The ID of a milestone to assign issue' optional :labels, type: String, desc: 'Comma-separated list of label names' - optional :due_date, type: String, desc: 'Date time string in the format YEAR-MONTH-DAY' + optional :due_date, type: String, desc: 'Date string in the format YEAR-MONTH-DAY' optional :confidential, type: Boolean, desc: 'Boolean parameter if the issue should be confidential' end diff --git a/lib/api/users.rb b/lib/api/users.rb index eedc59f8636..16fa1ef6836 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -534,6 +534,24 @@ module API email.destroy current_user.update_secondary_emails! end + + + desc 'Get a list of user activities' + params do + optional :from, type: String, desc: 'Date string in the format YEAR-MONTH-DAY' + use :pagination + end + get ":activities" do + authenticated_as_admin! + + activity_set = Gitlab::UserActivities::ActivitySet.new(from: params[:from], + page: params[:page], + per_page: params[:per_page]) + + add_pagination_headers(activity_set) + + present activity_set.activities, with: Entities::UserActivity + end end end end |