Commit 7096ebe8 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #9048 from NARKOZ/api

properly paginate project events in API
parents ccab346a bba2b10e
......@@ -95,10 +95,7 @@ module API
# 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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment