2023-03-22 17:29:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
DiscourseDataExplorer::Engine.routes.draw do
|
|
|
|
root to: "query#index"
|
|
|
|
get "queries" => "query#index"
|
|
|
|
|
|
|
|
scope "/", defaults: { format: :json } do
|
|
|
|
get "schema" => "query#schema"
|
|
|
|
get "groups" => "query#groups"
|
|
|
|
post "queries" => "query#create"
|
|
|
|
get "queries/:id" => "query#show"
|
|
|
|
put "queries/:id" => "query#update"
|
|
|
|
delete "queries/:id" => "query#destroy"
|
|
|
|
post "queries/:id/run" => "query#run", :constraints => { format: /(json|csv)/ }
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2023-06-16 08:38:56 -04:00
|
|
|
Discourse::Application.routes.draw do
|
2023-03-22 17:29:08 -04:00
|
|
|
get "/g/:group_name/reports" => "discourse_data_explorer/query#group_reports_index"
|
|
|
|
get "/g/:group_name/reports/:id" => "discourse_data_explorer/query#group_reports_show"
|
|
|
|
post "/g/:group_name/reports/:id/run" => "discourse_data_explorer/query#group_reports_run"
|
|
|
|
|
|
|
|
mount DiscourseDataExplorer::Engine, at: "/admin/plugins/explorer"
|
|
|
|
end
|