Add graphs and retention metrics to admin dashboard (#16829)
This commit is contained in:
16
app/controllers/api/v1/admin/trends_controller.rb
Normal file
16
app/controllers/api/v1/admin/trends_controller.rb
Normal file
@@ -0,0 +1,16 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class Api::V1::Admin::TrendsController < Api::BaseController
|
||||
before_action :require_staff!
|
||||
before_action :set_trends
|
||||
|
||||
def index
|
||||
render json: @trends, each_serializer: REST::Admin::TagSerializer
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def set_trends
|
||||
@trends = TrendingTags.get(10, filtered: false)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user