2023-09-04 15:55:51 +02:00
|
|
|
// import { geoLocationSearch, providerDetails } from "../lib/location-utilities";
|
|
|
|
//import { ajax } from "discourse/lib/ajax";
|
|
|
|
import { action, set } from "@ember/object";
|
|
|
|
// import { equal } from "@ember/object/computed";
|
|
|
|
// import { A } from "@ember/array";
|
|
|
|
import { inject as service } from "@ember/service";
|
|
|
|
import Component from "@glimmer/component";
|
|
|
|
import { tracked } from "@glimmer/tracking";
|
2023-09-08 11:54:41 +02:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2023-09-04 15:55:51 +02:00
|
|
|
// import I18n from "I18n";
|
|
|
|
|
|
|
|
export default class WizardSubscriptionAuthorize extends Component {
|
|
|
|
@service siteSettings;
|
2023-09-08 11:54:41 +02:00
|
|
|
@tracked supplierId = null;
|
2023-09-08 20:14:36 +02:00
|
|
|
@tracked authorized = false;
|
2023-09-04 15:55:51 +02:00
|
|
|
|
|
|
|
constructor() {
|
|
|
|
super(...arguments);
|
2023-09-08 20:14:36 +02:00
|
|
|
ajax("/admin/plugins/subscription-client/suppliers").then((result) => {
|
|
|
|
this.supplierId = result.suppliers[0].id;
|
|
|
|
this.authorized = result.suppliers[0].authorized;
|
|
|
|
})
|
2023-09-04 15:55:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
authorize() {
|
2023-09-08 20:14:36 +02:00
|
|
|
window.location.href = `/admin/plugins/subscription-client/suppliers/authorize?supplier_id=${this.supplierId}`;
|
2023-09-04 15:55:51 +02:00
|
|
|
}
|
|
|
|
}
|