Commit 53d99f9e83d074d0748bdf5eb0afa85389ad9fba

Authored by Caio Almeida
1 parent d782d26b

API: removing uncessary code to expose tags

lib/noosfero/api/api.rb
@@ -45,7 +45,6 @@ module Noosfero @@ -45,7 +45,6 @@ module Noosfero
45 mount V1::Enterprises 45 mount V1::Enterprises
46 mount V1::Categories 46 mount V1::Categories
47 mount V1::Tasks 47 mount V1::Tasks
48 - mount V1::Tags  
49 mount V1::Environments 48 mount V1::Environments
50 mount Session 49 mount Session
51 50
lib/noosfero/api/entities.rb
@@ -114,11 +114,6 @@ module Noosfero @@ -114,11 +114,6 @@ module Noosfero
114 expose :type 114 expose :type
115 end 115 end
116 116
117 - class Tag < Entity  
118 - root 'tags', 'tag'  
119 - expose :name  
120 - end  
121 -  
122 class Environment < Entity 117 class Environment < Entity
123 expose :name 118 expose :name
124 end 119 end
lib/noosfero/api/v1/tags.rb
@@ -10,7 +10,7 @@ module Noosfero @@ -10,7 +10,7 @@ module Noosfero
10 10
11 get do 11 get do
12 article = find_article(environment.articles, params[:id]) 12 article = find_article(environment.articles, params[:id])
13 - present article.tag_list, :with => Entities::Tag 13 + present article.tag_list
14 end 14 end
15 15
16 desc "Add a tag to an article" 16 desc "Add a tag to an article"
@@ -18,7 +18,7 @@ module Noosfero @@ -18,7 +18,7 @@ module Noosfero
18 article = find_article(environment.articles, params[:id]) 18 article = find_article(environment.articles, params[:id])
19 article.tag_list=params[:tags] 19 article.tag_list=params[:tags]
20 article.save 20 article.save
21 - present article.tag_list, :with => Entities::Tag 21 + present article.tag_list
22 end 22 end
23 23
24 end 24 end