2020-09-02 00:13:10 +00:00
|
|
|
# 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
|
2020-12-23 15:43:38 +00:00
|
|
|
render json: @featured_tags, each_serializer: REST::FeaturedTagSerializer
|
2020-09-02 00:13:10 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def set_account
|
|
|
|
@account = Account.find(params[:account_id])
|
|
|
|
end
|
|
|
|
|
|
|
|
def set_featured_tags
|
2020-12-04 03:22:35 +00:00
|
|
|
@featured_tags = @account.suspended? ? [] : @account.featured_tags
|
2020-09-02 00:13:10 +00:00
|
|
|
end
|
|
|
|
end
|