Commit f712bcbdc1548e3c974751090bc026fff91abcde
1 parent
8cffa2cb
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
api: fix article children pagination
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
| @@ -142,13 +142,13 @@ module Noosfero | @@ -142,13 +142,13 @@ module Noosfero | ||
| 142 | {:vote => vote.save} | 142 | {:vote => vote.save} |
| 143 | end | 143 | end |
| 144 | 144 | ||
| 145 | - paginate per_page: MAX_PER_PAGE, max_per_page: MAX_PER_PAGE | ||
| 146 | desc 'Return the children of a article identified by id' do | 145 | desc 'Return the children of a article identified by id' do |
| 147 | detail 'Get all children articles of a specific article' | 146 | detail 'Get all children articles of a specific article' |
| 148 | params Noosfero::API::Entities::Article.documentation | 147 | params Noosfero::API::Entities::Article.documentation |
| 149 | failure [[403, 'Forbidden']] | 148 | failure [[403, 'Forbidden']] |
| 150 | named 'ArticleChildren' | 149 | named 'ArticleChildren' |
| 151 | end | 150 | end |
| 151 | + paginate per_page: MAX_PER_PAGE, max_per_page: MAX_PER_PAGE | ||
| 152 | get ':id/children' do | 152 | get ':id/children' do |
| 153 | article = find_article(environment.articles, params[:id]) | 153 | article = find_article(environment.articles, params[:id]) |
| 154 | 154 | ||
| @@ -164,7 +164,7 @@ module Noosfero | @@ -164,7 +164,7 @@ module Noosfero | ||
| 164 | end | 164 | end |
| 165 | 165 | ||
| 166 | Article.hit(articles) | 166 | Article.hit(articles) |
| 167 | - present articles, :with => Entities::Article, :fields => params[:fields] | 167 | + present_articles_paginated(articles) |
| 168 | end | 168 | end |
| 169 | 169 | ||
| 170 | desc 'Return one child of a article identified by id' do | 170 | desc 'Return one child of a article identified by id' do |