Commit dc71405273f6ba01a8f3d31dc805e5eef2461f4c
1 parent
08c458a5
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
Adding post endpoint
Showing
1 changed file
with
7 additions
and
0 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
| ... | ... | @@ -35,6 +35,13 @@ module Noosfero |
| 35 | 35 | present_article(environment) |
| 36 | 36 | end |
| 37 | 37 | |
| 38 | + post ':id' do | |
| 39 | + article = environment.articles.find(params[:id]) | |
| 40 | + return forbidden! if article.allow_edit?(current_person) | |
| 41 | + article.update_attributes!(params[:article]) | |
| 42 | + present article, :with => Entities::Article, :fields => params[:fields] | |
| 43 | + end | |
| 44 | + | |
| 38 | 45 | post ':id/report_abuse' do |
| 39 | 46 | article = find_article(environment.articles, params[:id]) |
| 40 | 47 | profile = article.profile | ... | ... |