2024-12-07 17:30:25 +01:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module ::DiscourseRewind
|
|
|
|
class RewindsController < ::ApplicationController
|
|
|
|
requires_plugin PLUGIN_NAME
|
|
|
|
|
|
|
|
skip_before_action :preload_json, :check_xhr, :redirect_to_login_if_required, only: %i[show]
|
|
|
|
|
|
|
|
def show
|
2024-12-07 17:53:47 +01:00
|
|
|
# expires_in 1.minute, public: false
|
2024-12-07 17:30:25 +01:00
|
|
|
response.headers["X-Robots-Tag"] = "noindex"
|
|
|
|
|
2024-12-07 18:40:23 +01:00
|
|
|
DiscourseRewind::Rewind::Fetch.call(service_params) do
|
|
|
|
on_success do |reports:|
|
|
|
|
@reports = reports
|
|
|
|
render "show", layout: false
|
|
|
|
end
|
|
|
|
end
|
2024-12-07 17:30:25 +01:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|