0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-09 20:02:54 +01:00

Merge branch 'use_subscription_gem' of github.com:paviliondev/discourse-custom-wizard into use_subscription_gem

Dieser Commit ist enthalten in:
merefield 2023-09-22 14:05:47 +01:00
Commit 76288932c8

Datei anzeigen

@ -16,7 +16,8 @@ export default class WizardSubscriptionStatus extends Component {
constructor() { constructor() {
super(...arguments); super(...arguments);
ajax("/admin/plugins/subscription-client/suppliers?final_landing_path%3D%2Fadmin%2Fwizards%2Fwizard").then((result) => { ajax("/admin/plugins/subscription-client/suppliers").then((result) => {
console.log(result)
this.supplierId = result.suppliers[0].id; this.supplierId = result.suppliers[0].id;
this.authorized = result.suppliers[0].authorized; this.authorized = result.suppliers[0].authorized;
}) })
@ -24,7 +25,7 @@ export default class WizardSubscriptionStatus extends Component {
@action @action
authorize() { authorize() {
window.location.href = `${this.basePath}/authorize?supplier_id=${this.supplierId}`; window.location.href = `${this.basePath}/authorize?supplier_id=${this.supplierId}&final_landing_path=/admin/wizards/wizard`;
} }
@action @action
@ -39,8 +40,8 @@ export default class WizardSubscriptionStatus extends Component {
}) })
.then((result) => { .then((result) => {
console.log(result); console.log(result);
this.supplierId = result.suppliers[0].id; this.supplierId = result.supplier.id;
this.authorized = result.suppliers[0].authorized; this.authorized = !(result.supplier.authorized_at === null);
}) })
.finally(() => { .finally(() => {
this.unauthorizing = false; this.unauthorizing = false;