mirror of
https://github.com/discourse/discourse-rewind.git
synced 2025-07-06 22:02:12 +00:00
21 lines
524 B
Ruby
21 lines
524 B
Ruby
# frozen_string_literal: true
|
|
|
|
module ::DiscourseRewind
|
|
class RewindsController < ::ApplicationController
|
|
requires_plugin PLUGIN_NAME
|
|
|
|
requires_login
|
|
|
|
def show
|
|
DiscourseRewind::FetchReports.call(service_params) do
|
|
on_model_not_found(:year) { raise Discourse::NotFound }
|
|
on_model_not_found(:user) { raise Discourse::NotFound }
|
|
on_success do |reports:|
|
|
@reports = reports
|
|
render json: MultiJson.dump(reports), status: 200
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|