about summary refs log tree commit diff
path: root/app/controllers/api/v1/accounts/featured_tags_controller.rb
blob: d6277261d4503e35d90d99d688bf336bbe0e2ff2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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