0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 04:12:53 +01:00
discourse-custom-wizard/assets/javascripts/discourse/models/custom-wizard-notice.js.es6
2021-10-05 20:54:06 +08:00

23 Zeilen
Kein EOL
603 B
JavaScript

import EmberObject from "@ember/object";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
const CustomWizardNotice = EmberObject.extend();
CustomWizardNotice.reopen({
dismiss() {
return ajax(`/admin/wizards/notice/${this.id}`, { type: 'PUT' }).then(result => {
if (result.success) {
this.set('dismissed_at', result.dismissed_at);
}
}).catch(popupAjaxError);
}
});
CustomWizardNotice.reopenClass({
list() {
return ajax('/admin/wizards/notice').catch(popupAjaxError);
}
});
export default CustomWizardNotice;