22 lines
549 B
Ruby
Raw Normal View History

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
# 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