2023-09-24 08:56:39 +02:00
|
|
|
# frozen_string_literal: true
|
|
|
|
class CustomWizard::SubscriptionController < ::Admin::AdminController
|
|
|
|
before_action :ensure_admin
|
2024-10-16 14:18:23 +02:00
|
|
|
requires_plugin "discourse-custom-wizard"
|
2023-09-24 08:56:39 +02:00
|
|
|
|
|
|
|
def index
|
2023-11-15 16:36:21 +01:00
|
|
|
if params[:update_from_remote]
|
|
|
|
subscription = CustomWizard::Subscription.new(true)
|
|
|
|
else
|
|
|
|
subscription = CustomWizard::Subscription.new
|
|
|
|
end
|
|
|
|
|
2023-09-24 08:56:39 +02:00
|
|
|
render_json_dump(
|
2023-09-24 11:02:52 +02:00
|
|
|
subscribed: subscription.subscribed?,
|
|
|
|
subscription_type: subscription.type,
|
2023-09-24 08:56:39 +02:00
|
|
|
subscription_attributes: CustomWizard::Subscription.attributes,
|
|
|
|
)
|
|
|
|
end
|
2023-09-24 13:20:57 +02:00
|
|
|
end
|