0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-09-21 00:01:12 +02:00
discourse-custom-wizard/assets/javascripts/discourse/models/custom-wizard-pro.js.es6

34 Zeilen
714 B
Text

import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import EmberObject from "@ember/object";
const CustomWizardPro = EmberObject.extend();
const basePath = "/admin/wizards/pro";
CustomWizardPro.reopenClass({
status() {
return ajax(basePath, {
type: "GET",
}).catch(popupAjaxError);
},
authorize() {
window.location.href = `${basePath}/authorize`;
},
unauthorize() {
return ajax(`${basePath}/authorize`, {
type: "DELETE",
}).catch(popupAjaxError);
},
2021-09-07 14:13:01 +02:00
update_subscription() {
return ajax(`${basePath}/subscription`, {
type: "POST",
}).catch(popupAjaxError);
2021-09-07 14:13:01 +02:00
},
});
2021-09-07 14:13:01 +02:00
export default CustomWizardPro;