The code powering m.abunchtell.com https://m.abunchtell.com
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.
 
 
 
 

21 lines
534 B

  1. # frozen_string_literal: true
  2. class Api::V1::FeaturedTags::SuggestionsController < Api::BaseController
  3. before_action -> { doorkeeper_authorize! :read, :'read:accounts' }, only: :index
  4. before_action :require_user!
  5. before_action :set_most_used_tags, only: :index
  6. respond_to :json
  7. def index
  8. render json: @most_used_tags, each_serializer: REST::TagSerializer
  9. end
  10. private
  11. def set_most_used_tags
  12. @most_used_tags = Tag.most_used(current_account).where.not(id: current_account.featured_tags).limit(10)
  13. end
  14. end