Added account featured tags API (#11817)
This commit is contained in:
parent
17340365bb
commit
33ad850c98
3 changed files with 42 additions and 0 deletions
22
app/controllers/api/v1/accounts/featured_tags_controller.rb
Normal file
22
app/controllers/api/v1/accounts/featured_tags_controller.rb
Normal file
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue