1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/models/custom-wizard-pro.js.es6
2021-09-07 20:15:04 +08:00

33 Zeilen
714 B
JavaScript

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);
},
update_subscription() {
return ajax(`${basePath}/subscription`, {
type: "POST",
}).catch(popupAjaxError);
},
});
export default CustomWizardPro;