mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 16:11:08 +08:00
Code to support EmberJS + Discourse Tutorial feature: Admin Reports
This commit is contained in:
17
app/controllers/admin/reports_controller.rb
Normal file
17
app/controllers/admin/reports_controller.rb
Normal file
@ -0,0 +1,17 @@
|
||||
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
|
Reference in New Issue
Block a user