diff options
author | Stephan van Leeuwen <stephan.vanleeuwen5@gmail.com> | 2014-12-21 13:35:11 +0100 |
---|---|---|
committer | Stephan van Leeuwen <stephan.vanleeuwen5@gmail.com> | 2015-03-24 19:11:48 +0100 |
commit | 3b3662da0a5f31dddbe19be7f8e787c1b90b1b22 (patch) | |
tree | 160b299c7d747a1e4e8bfd1ae4d421f949b20c25 /lib/api/projects.rb | |
parent | c3c9703437a552700c2a6ca010b05cc56aa6d73a (diff) | |
download | gitlab-ce-3b3662da0a5f31dddbe19be7f8e787c1b90b1b22.tar.gz |
Updated api method GET /projects/:id/events to use paginate instead of a self-implementation
Also updated example request url
Added changelog item
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 83f65eec6cc..e3fff79d68f 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -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 |