Updated api method GET /projects/:id/events to use paginate instead of a self-implementation
Also updated example request url Added changelog item
This commit is contained in:
parent
c3c9703437
commit
3b3662da0a
|
@ -33,6 +33,7 @@ v 7.10.0 (unreleased)
|
|||
- Don't show commit comment button when user is not signed in.
|
||||
- Don't include system notes in issue/MR comment count.
|
||||
- Don't mark merge request as updated when merge status relative to target branch changes.
|
||||
- API: Add pagination to project events
|
||||
|
||||
v 7.9.0
|
||||
- Send EmailsOnPush email when branch or tag is created or deleted.
|
||||
|
|
|
@ -88,17 +88,14 @@ module API
|
|||
present user_project, with: Entities::ProjectWithAccess, user: current_user
|
||||
end
|
||||
|
||||
# Get a single project events
|
||||
# Get events for a single project
|
||||
#
|
||||
# Parameters:
|
||||
# id (required) - The ID of a project
|
||||
# Example Request:
|
||||
# GET /projects/:id/events
|
||||
get ":id/events" do
|
||||
limit = (params[:per_page] || 20).to_i
|
||||
offset = (params[:page] || 0).to_i * limit
|
||||
events = user_project.events.recent.limit(limit).offset(offset)
|
||||
|
||||
events = paginate user_project.events.recent
|
||||
present events, with: Entities::Event
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue