Commit 055920fc17d0c374ad18edb6b68bb4e2a913dfe6

Authored by Victor Costa
1 parent 043be0b1

api: expose replies of a comment

Showing 1 changed file with 7 additions and 2 deletions   Show diff stats
lib/noosfero/api/entities.rb
@@ -183,11 +183,16 @@ module Noosfero @@ -183,11 +183,16 @@ module Noosfero
183 expose :children, :using => ArticleBase 183 expose :children, :using => ArticleBase
184 end 184 end
185 185
186 - class Comment < Entity  
187 - root 'comments', 'comment' 186 + class CommentBase < Entity
188 expose :body, :title, :id 187 expose :body, :title, :id
189 expose :created_at, :format_with => :timestamp 188 expose :created_at, :format_with => :timestamp
190 expose :author, :using => Profile 189 expose :author, :using => Profile
  190 + expose :reply_of, :using => CommentBase
  191 + end
  192 +
  193 + class Comment < CommentBase
  194 + root 'comments', 'comment'
  195 + expose :children, as: :replies, :using => Comment
191 end 196 end
192 197
193 class User < Entity 198 class User < Entity