闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
473 B

  1. # frozen_string_literal: true
  2. class Api::V1::Accounts::FeaturedTagsController < Api::BaseController
  3. before_action :set_account
  4. before_action :set_featured_tags
  5. respond_to :json
  6. def index
  7. render json: @featured_tags, each_serializer: REST::FeaturedTagSerializer
  8. end
  9. private
  10. def set_account
  11. @account = Account.find(params[:account_id])
  12. end
  13. def set_featured_tags
  14. @featured_tags = @account.suspended? ? [] : @account.featured_tags
  15. end
  16. end