Commit c7dc5dc421f53e50f8c0a0278adf86fd94696fd9
1 parent
73a69dfa
Exists in
staging
and in
3 other branches
api: return profile home page
Showing
1 changed file
with
9 additions
and
0 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
@@ -260,6 +260,15 @@ module Noosfero | @@ -260,6 +260,15 @@ module Noosfero | ||
260 | 260 | ||
261 | end | 261 | end |
262 | 262 | ||
263 | + resource :profiles do | ||
264 | + get ':id/home_page' do | ||
265 | + profiles = environment.profiles | ||
266 | + profiles = profiles.visible_for_person(current_person) | ||
267 | + profile = profiles.find_by_id(params[:id]) | ||
268 | + present_partial profile.home_page, :with => Entities::Article | ||
269 | + end | ||
270 | + end | ||
271 | + | ||
263 | kinds = %w[profile community person enterprise] | 272 | kinds = %w[profile community person enterprise] |
264 | kinds.each do |kind| | 273 | kinds.each do |kind| |
265 | resource kind.pluralize.to_sym do | 274 | resource kind.pluralize.to_sym do |