mirror of
https://github.com/discourse/discourse.git
synced 2024-12-17 14:48:44 +08:00
18 lines
342 B
Ruby
18 lines
342 B
Ruby
|
require_dependency 'report'
|
||
|
|
||
|
class Admin::ReportsController < Admin::AdminController
|
||
|
|
||
|
def show
|
||
|
|
||
|
report_type = params[:type]
|
||
|
|
||
|
raise Discourse::NotFound.new unless report_type =~ /^[a-z0-9\_]+$/
|
||
|
|
||
|
report = Report.find(report_type)
|
||
|
raise Discourse::NotFound.new if report.blank?
|
||
|
|
||
|
render_json_dump(report: report)
|
||
|
end
|
||
|
|
||
|
end
|