This repository has been archived on 2024-07-31. You can view files and clone it, but cannot push or open issues or pull requests.
2021-11-25 07:07:38 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class Api::V1::Trends::TagsController < Api::BaseController
|
|
|
|
before_action :set_tags
|
|
|
|
|
|
|
|
def index
|
|
|
|
render json: @tags, each_serializer: REST::TagSerializer
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def set_tags
|
|
|
|
@tags = begin
|
|
|
|
if Setting.trends
|
2022-02-24 18:34:14 -05:00
|
|
|
Trends.tags.query.allowed.limit(limit_param(10))
|
2021-11-25 07:07:38 -05:00
|
|
|
else
|
|
|
|
[]
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|