2019-04-17 07:13:48 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module API
|
2020-10-14 20:08:42 -04:00
|
|
|
class ProjectEvents < ::API::Base
|
2019-04-17 07:13:48 -04:00
|
|
|
include PaginationParams
|
|
|
|
include APIGuard
|
|
|
|
helpers ::API::Helpers::EventsHelpers
|
|
|
|
|
2020-10-30 11:08:59 -04:00
|
|
|
feature_category :users
|
|
|
|
|
2022-04-19 11:08:32 -04:00
|
|
|
# TODO: Set higher urgency after resolving https://gitlab.com/gitlab-org/gitlab/-/issues/357839
|
|
|
|
urgency :low
|
|
|
|
|
2019-04-17 07:13:48 -04:00
|
|
|
params do
|
|
|
|
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
|
|
|
|
success Entities::Event
|
|
|
|
end
|
|
|
|
params do
|
|
|
|
use :pagination
|
|
|
|
use :event_filter_params
|
|
|
|
use :sort_params
|
|
|
|
end
|
|
|
|
|
|
|
|
get ":id/events" do
|
|
|
|
events = find_events(user_project)
|
|
|
|
|
|
|
|
present_events(events)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|