Skip to content
Snippets Groups Projects
Unverified Commit 4950e59c authored by trwnh's avatar trwnh Committed by GitHub
Browse files

Use existing FeaturedTag serializer and delete AccountFeaturedTag serializer (#15415)

* Update featured_tags_controller.rb

* Update featured_tag_serializer.rb

* Update featured_tag_serializer.rb

* Delete account_featured_tag_serializer.rb

* please codeclimate

* please codeclimate
parent de57efd0
No related branches found
No related tags found
No related merge requests found
......@@ -7,7 +7,7 @@ class Api::V1::Accounts::FeaturedTagsController < Api::BaseController
respond_to :json
def index
render json: @featured_tags, each_serializer: REST::AccountFeaturedTagSerializer
render json: @featured_tags, each_serializer: REST::FeaturedTagSerializer
end
private
......
# frozen_string_literal: true
class REST::AccountFeaturedTagSerializer < ActiveModel::Serializer
include RoutingHelper
attributes :id, :name, :url
def id
object.tag.id.to_s
end
def url
short_account_tag_url(object.account, object.tag)
end
end
# frozen_string_literal: true
class REST::FeaturedTagSerializer < ActiveModel::Serializer
attributes :id, :name, :statuses_count, :last_status_at
include RoutingHelper
attributes :id, :name, :url, :statuses_count, :last_status_at
def id
object.id.to_s
end
def url
short_account_tag_url(object.account, object.tag)
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment