Commit a3e2483939bf55ed29952a840a6444e4cf200d88
Committed by
Rodrigo Souto
1 parent
76221bc1
Exists in
api_tasks
and in
4 other branches
api: fix article suggestion
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
lib/noosfero/api/v1/articles.rb
@@ -50,11 +50,11 @@ module Noosfero | @@ -50,11 +50,11 @@ module Noosfero | ||
50 | 50 | ||
51 | post ':id/children/suggest' do | 51 | post ':id/children/suggest' do |
52 | parent_article = environment.articles.find(params[:id]) | 52 | parent_article = environment.articles.find(params[:id]) |
53 | - profile = environment.profiles.find(params[:target_id]) | ||
54 | 53 | ||
55 | suggest_article = SuggestArticle.new | 54 | suggest_article = SuggestArticle.new |
56 | suggest_article.article = params[:article] | 55 | suggest_article.article = params[:article] |
57 | - suggest_article.target = profile | 56 | + suggest_article.article[:parent_id] = parent_article.id |
57 | + suggest_article.target = parent_article.profile | ||
58 | suggest_article.requestor = current_person | 58 | suggest_article.requestor = current_person |
59 | 59 | ||
60 | unless suggest_article.save | 60 | unless suggest_article.save |