move subscription back-end call
Dieser Commit ist enthalten in:
Ursprung
6a1ead0322
Commit
26e4267d23
3 geänderte Dateien mit 15 neuen und 1 gelöschten Zeilen
13
app/controllers/custom_wizard/admin/subscription.rb
Normale Datei
13
app/controllers/custom_wizard/admin/subscription.rb
Normale Datei
|
@ -0,0 +1,13 @@
|
|||
# frozen_string_literal: true
|
||||
class CustomWizard::SubscriptionController < ::Admin::AdminController
|
||||
before_action :ensure_admin
|
||||
|
||||
def index
|
||||
subcription = CustomWizard::Subscription.new
|
||||
render_json_dump(
|
||||
subscribed: subcription.subscribed?,
|
||||
subscription_type: subcription.type,
|
||||
subscription_attributes: CustomWizard::Subscription.attributes,
|
||||
)
|
||||
end
|
||||
end
|
|
@ -27,7 +27,7 @@ export default class SubscriptionService extends Service {
|
|||
}
|
||||
|
||||
retrieveSubscriptionStatus() {
|
||||
ajax("/admin/wizards").then(result => {
|
||||
ajax("/admin/subscription").then(result => {
|
||||
console.log(result)
|
||||
this.subscribed = result.subscribed;
|
||||
this.subscriptionType = result.subscription_type;
|
||||
|
|
|
@ -14,6 +14,7 @@ Discourse::Application.routes.append do
|
|||
|
||||
scope module: 'custom_wizard', constraints: AdminConstraint.new do
|
||||
get 'admin/wizards' => 'admin#index'
|
||||
get 'admin/subscription' => 'subscription#index'
|
||||
|
||||
get 'admin/wizards/wizard' => 'admin_wizard#index'
|
||||
get 'admin/wizards/wizard/create' => 'admin#index'
|
||||
|
|
Laden …
In neuem Issue referenzieren