mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: search log term details page (#5445)
This commit is contained in:
@@ -6,4 +6,17 @@ class Admin::SearchLogsController < Admin::AdminController
|
||||
render_serialized(SearchLog.trending(period&.to_sym, search_type&.to_sym), SearchLogsSerializer)
|
||||
end
|
||||
|
||||
def term
|
||||
params.require(:term)
|
||||
|
||||
term = params[:term]
|
||||
period = params[:period] || "yearly"
|
||||
search_type = params[:search_type] || "all"
|
||||
|
||||
details = SearchLog.term_details(term, period&.to_sym, search_type&.to_sym)
|
||||
raise Discourse::NotFound if details.blank?
|
||||
|
||||
render_json_dump(term: details)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user