about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2020-09-14 13:49:06 -0500
committerStarfall <us@starfall.systems>2020-09-14 13:49:06 -0500
commitbc32e736fbd7c6afd59e619c885fa80ab637324a (patch)
treeafc04eaa04aeb45b56c378bdc474428d6fdcc813 /app/controllers/api/v1/accounts
parentfd0b806603dbd632d259d06af789c7195c7264dc (diff)
parentafa753a890197b188ddf7ba6a8493d4fe361d956 (diff)
Merge branch 'glitch' into main
Diffstat (limited to 'app/controllers/api/v1/accounts')
-rw-r--r--app/controllers/api/v1/accounts/featured_tags_controller.rb22
1 files changed, 22 insertions, 0 deletions
diff --git a/app/controllers/api/v1/accounts/featured_tags_controller.rb b/app/controllers/api/v1/accounts/featured_tags_controller.rb
new file mode 100644
index 000000000..d6277261d
--- /dev/null
+++ b/app/controllers/api/v1/accounts/featured_tags_controller.rb
@@ -0,0 +1,22 @@
+# frozen_string_literal: true
+
+class Api::V1::Accounts::FeaturedTagsController < Api::BaseController
+  before_action :set_account
+  before_action :set_featured_tags
+
+  respond_to :json
+
+  def index
+    render json: @featured_tags, each_serializer: REST::AccountFeaturedTagSerializer
+  end
+
+  private
+
+  def set_account
+    @account = Account.find(params[:account_id])
+  end
+
+  def set_featured_tags
+    @featured_tags = @account.featured_tags
+  end
+end