Commit 5c39797bf9a5dd3ebd324126e6ee06d990266e9e
1 parent
fc162af5
Exists in
staging
and in
4 other branches
api: add activities endpoint
Showing
3 changed files
with
30 additions
and
0 deletions
Show diff stats
lib/noosfero/api/api.rb
lib/noosfero/api/entities.rb
... | ... | @@ -0,0 +1,25 @@ |
1 | +module Noosfero | |
2 | + module API | |
3 | + module V1 | |
4 | + class Activities < Grape::API | |
5 | + before { authenticate! } | |
6 | + | |
7 | + resource :profiles do | |
8 | + | |
9 | + get ':id/activities' do | |
10 | + profile = environment.profiles | |
11 | + profile = profile.visible_for_person(current_person) if profile.respond_to?(:visible_for_person) | |
12 | + profile = profile.find_by_id(params[:id]) | |
13 | + activities = profile.activities.map(&:activity) | |
14 | + present activities, :with => Entities::Activity, :current_person => current_person | |
15 | + end | |
16 | + | |
17 | + get ':id/network_activities' do | |
18 | + #TODO | |
19 | + end | |
20 | + | |
21 | + end | |
22 | + end | |
23 | + end | |
24 | + end | |
25 | +end | ... | ... |