Skip to content

Commit a163ba5

Browse files
authored
Merge pull request #295 from paviliondev/update_subscription_support
Update support to client gem version 0.1.6
2 parents 7e6749c + 9aa5c01 commit a163ba5

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

assets/javascripts/discourse/components/wizard-subscription-status.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,12 @@ export default class WizardSubscriptionStatus extends Component {
1515

1616
constructor() {
1717
super(...arguments);
18-
ajax(`${this.basePath}`)
18+
ajax(`${this.basePath}?resource=discourse-custom-wizard`)
1919
.then((result) => {
20-
this.supplierId = result.suppliers[0].id;
21-
this.authorized = result.suppliers[0].authorized;
20+
if (result.suppliers && result.suppliers.length) {
21+
this.supplierId = result.suppliers[0].id;
22+
this.authorized = result.suppliers[0].authorized;
23+
}
2224
})
2325
.finally(() => {
2426
this.subscription.retrieveSubscriptionStatus();
@@ -41,8 +43,10 @@ export default class WizardSubscriptionStatus extends Component {
4143
},
4244
})
4345
.then((result) => {
44-
this.supplierId = result.supplier.id;
45-
this.authorized = !(result.supplier.authorized_at === null);
46+
if (result.success) {
47+
this.supplierId = result.supplier_id;
48+
this.authorized = false;
49+
}
4650
})
4751
.finally(() => {
4852
this.unauthorizing = false;

plugin.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# frozen_string_literal: true
22
# name: discourse-custom-wizard
33
# about: Forms for Discourse. Better onboarding, structured posting, data enrichment, automated actions and much more.
4-
# version: 2.8.10
4+
# version: 2.8.11
55
# authors: Angus McLeod, Faizaan Gagan, Robert Barrow, Keegan George, Kaitlin Maddever, Juan Marcos Gutierrez Ramos
66
# url: https://github.com/paviliondev/discourse-custom-wizard
77
# contact_emails: [email protected]
88
# subscription_url: https://coop.pavilion.tech
99
# meta_topic_id: 73345
1010

1111
gem 'liquid', '5.5.0', require: true
12-
gem "discourse_subscription_client", "0.1.2", require_name: "discourse_subscription_client"
12+
gem "discourse_subscription_client", "0.1.6", require_name: "discourse_subscription_client"
1313
gem 'discourse_plugin_statistics', '0.1.0.pre7', require: true
1414
register_asset 'stylesheets/common/admin.scss'
1515
register_asset 'stylesheets/common/wizard.scss'

0 commit comments

Comments
 (0)