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 ...@@ -95,10 +95,7 @@ module API
# Example Request: # Example Request:
# GET /projects/:id/events # GET /projects/:id/events
get ":id/events" do get ":id/events" do
limit = (params[:per_page] || 20).to_i events = paginate user_project.events.recent
offset = (params[:page] || 0).to_i * limit
events = user_project.events.recent.limit(limit).offset(offset)
present events, with: Entities::Event present events, with: Entities::Event
end 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