Commit 294b2f50d8219e03419f351a5557e785d0fcd493
Committed by
Rodrigo Souto
1 parent
7f14c33d
Exists in
master
and in
29 other branches
api: fix documentation for articles
Showing
1 changed file
with
8 additions
and
8 deletions
Show diff stats
lib/api/v1/articles.rb
@@ -5,12 +5,12 @@ module API | @@ -5,12 +5,12 @@ module API | ||
5 | 5 | ||
6 | resource :articles do | 6 | resource :articles do |
7 | 7 | ||
8 | - # Collect comments from articles | 8 | + # Collect articles |
9 | # | 9 | # |
10 | # Parameters: | 10 | # Parameters: |
11 | # from - date where the search will begin. If nothing is passed the default date will be the date of the first article created | 11 | # from - date where the search will begin. If nothing is passed the default date will be the date of the first article created |
12 | - # oldest - Collect the oldest comments from reference_id comment. If nothing is passed the newest comments are collected | ||
13 | - # limit - amount of comments returned. The default value is 20 | 12 | + # oldest - Collect the oldest articles. If nothing is passed the newest articles are collected |
13 | + # limit - amount of articles returned. The default value is 20 | ||
14 | # | 14 | # |
15 | # Example Request: | 15 | # Example Request: |
16 | # GET /api/v1/articles?from=2013-04-04-14:41:43&until=2014-04-04-14:41:43&limit=10&content_type=Hub | 16 | # GET /api/v1/articles?from=2013-04-04-14:41:43&until=2014-04-04-14:41:43&limit=10&content_type=Hub |
@@ -20,7 +20,7 @@ module API | @@ -20,7 +20,7 @@ module API | ||
20 | get do | 20 | get do |
21 | articles = select_filtered_collection_of(environment, 'articles', params) | 21 | articles = select_filtered_collection_of(environment, 'articles', params) |
22 | articles = articles.where(Article.display_filter(current_user.person, nil)[:conditions]) | 22 | articles = articles.where(Article.display_filter(current_user.person, nil)[:conditions]) |
23 | - present articles, :with => Entities::Article | 23 | + present articles, :with => Entities::Article |
24 | end | 24 | end |
25 | 25 | ||
26 | desc "Return the article id" | 26 | desc "Return the article id" |
@@ -43,14 +43,14 @@ module API | @@ -43,14 +43,14 @@ module API | ||
43 | 43 | ||
44 | end | 44 | end |
45 | 45 | ||
46 | - resource :communities do | ||
47 | - segment '/:community_id' do | 46 | + resource :communities do |
47 | + segment '/:community_id' do | ||
48 | resource :articles do | 48 | resource :articles do |
49 | get do | 49 | get do |
50 | community = environment.communities.find(params[:community_id]) | 50 | community = environment.communities.find(params[:community_id]) |
51 | articles = select_filtered_collection_of(community, 'articles', params) | 51 | articles = select_filtered_collection_of(community, 'articles', params) |
52 | articles = articles.where(Article.display_filter(current_user.person, community)[:conditions]) | 52 | articles = articles.where(Article.display_filter(current_user.person, community)[:conditions]) |
53 | - present articles, :with => Entities::Article | 53 | + present articles, :with => Entities::Article |
54 | end | 54 | end |
55 | 55 | ||
56 | get '/:id' do | 56 | get '/:id' do |
@@ -81,7 +81,7 @@ module API | @@ -81,7 +81,7 @@ module API | ||
81 | end | 81 | end |
82 | 82 | ||
83 | end | 83 | end |
84 | - | 84 | + |
85 | end | 85 | end |
86 | end | 86 | end |
87 | end | 87 | end |