summaryrefslogtreecommitdiff
path: root/lib/api/events.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/events.rb')
-rw-r--r--lib/api/events.rb30
1 files changed, 15 insertions, 15 deletions
diff --git a/lib/api/events.rb b/lib/api/events.rb
index b98aa9f31e1..0dcd2d0396b 100644
--- a/lib/api/events.rb
+++ b/lib/api/events.rb
@@ -7,15 +7,15 @@ module API
helpers do
params :event_filter_params do
- optional :action, type: String, values: Event.actions, desc: 'Event action to filter on'
- optional :target_type, type: String, values: Event.target_types, desc: 'Event target type to filter on'
- optional :before, type: Date, desc: 'Include only events created before this date'
- optional :after, type: Date, desc: 'Include only events created after this date'
+ optional :action, type: String, values: Event.actions, desc: "Event action to filter on"
+ optional :target_type, type: String, values: Event.target_types, desc: "Event target type to filter on"
+ optional :before, type: Date, desc: "Include only events created before this date"
+ optional :after, type: Date, desc: "Include only events created after this date"
end
params :sort_params do
- optional :sort, type: String, values: %w[asc desc], default: 'desc',
- desc: 'Return events sorted in ascending and descending order'
+ optional :sort, type: String, values: %w[asc desc], default: "desc",
+ desc: "Return events sorted in ascending and descending order"
end
def present_events(events)
@@ -30,10 +30,10 @@ module API
end
resource :events do
- allow_access_with_scope :read_user, if: -> (request) { request.get? }
+ allow_access_with_scope :read_user, if: ->(request) { request.get? }
desc "List currently authenticated user's events" do
- detail 'This feature was introduced in GitLab 9.3.'
+ detail "This feature was introduced in GitLab 9.3."
success Entities::Event
end
params do
@@ -52,13 +52,13 @@ module API
end
params do
- requires :id, type: String, desc: 'The ID or Username of the user'
+ requires :id, type: String, desc: "The ID or Username of the user"
end
resource :users do
- allow_access_with_scope :read_user, if: -> (request) { request.get? }
+ allow_access_with_scope :read_user, if: ->(request) { request.get? }
- desc 'Get the contribution events of a specified user' do
- detail 'This feature was introduced in GitLab 8.13.'
+ desc "Get the contribution events of a specified user" do
+ detail "This feature was introduced in GitLab 8.13."
success Entities::Event
end
params do
@@ -67,9 +67,9 @@ module API
use :sort_params
end
- get ':id/events' do
+ get ":id/events" do
user = find_user(params[:id])
- not_found!('User') unless user
+ not_found!("User") unless user
events = find_events(user)
@@ -78,7 +78,7 @@ module API
end
params do
- requires :id, type: String, desc: 'The ID of a project'
+ requires :id, type: String, desc: "The ID of a project"
end
resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do
desc "List a Project's visible events" do