diff --git a/app/api/v1/tags.rb b/app/api/v1/tags.rb index cdfa380..37a4db8 100644 --- a/app/api/v1/tags.rb +++ b/app/api/v1/tags.rb @@ -1,12 +1,8 @@ module Api module V1 class Tags < Grape::API - before { authenticate! } - resource :articles do - resource ':id/tags' do - get do article = find_article(environment.articles, params[:id]) present article.tag_list @@ -14,6 +10,7 @@ module Api desc "Add a tag to an article" post do + authenticate! article = find_article(environment.articles, params[:id]) article.tag_list=params[:tags] article.save @@ -21,6 +18,13 @@ module Api end end end + + resource :environment do + desc 'Return the tag counts for this environment' + get '/tags' do + present environment.tag_counts + end + end end end end -- libgit2 0.21.2