about summary refs log tree commit diff
path: root/app/controllers/api/v1
diff options
context:
space:
mode:
authorThibaut Girka <thib@sitedethib.com>2020-09-07 09:21:38 +0200
committerThibaut Girka <thib@sitedethib.com>2020-09-07 09:21:38 +0200
commite5f934ddf0aa4ef9efbf45751bc00bebff768d99 (patch)
tree322231d7d50704edf8da762b69ee22c9850f2ce3 /app/controllers/api/v1
parentd967251fdc3826ad27d30e55258cfa4cdfd7c871 (diff)
parenta6121a159c5305ea9faa95743a50babb23ab41cd (diff)
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts:
- `app/controllers/activitypub/collections_controller.rb`:
  Conflict caused because we have additional code to make sure pinned
  local-only toots don't get rendered on the ActivityPub endpoints.
  Ported upstream changes.
Diffstat (limited to 'app/controllers/api/v1')
-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