mirror of
https://github.com/redmine/redmine.git
synced 2024-08-28 17:57:25 +02:00
Makes /projects API accept same pagination parameters as other API collection resources.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4572 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
d076c19822
commit
283d25d823
@ -53,7 +53,9 @@ class ProjectsController < ApplicationController
|
||||
@projects = Project.visible.find(:all, :order => 'lft')
|
||||
}
|
||||
format.api {
|
||||
@projects = Project.visible.find(:all, :order => 'lft')
|
||||
@offset, @limit = api_offset_and_limit
|
||||
@project_count = Project.visible.count
|
||||
@projects = Project.visible.all(:offset => @offset, :limit => @limit, :order => 'lft')
|
||||
}
|
||||
format.atom {
|
||||
projects = Project.visible.find(:all, :order => 'created_on DESC',
|
||||
|
@ -1,4 +1,4 @@
|
||||
api.array :projects do
|
||||
api.array :projects, api_meta(:total_count => @project_count, :offset => @offset, :limit => @limit) do
|
||||
@projects.each do |project|
|
||||
api.project do
|
||||
api.id project.id
|
||||
|
Loading…
Reference in New Issue
Block a user