2021-09-24 11:58:42 +02:00
|
|
|
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() {
|
2021-10-19 14:49:06 +02:00
|
|
|
return ajax(`/admin/wizards/notice/${this.id}`, { type: "PUT" })
|
|
|
|
.then((result) => {
|
|
|
|
if (result.success) {
|
|
|
|
this.set("dismissed_at", result.dismissed_at);
|
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(popupAjaxError);
|
|
|
|
},
|
2021-09-24 11:58:42 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
CustomWizardNotice.reopenClass({
|
|
|
|
list() {
|
2021-10-19 14:49:06 +02:00
|
|
|
return ajax("/admin/wizards/notice").catch(popupAjaxError);
|
|
|
|
},
|
2021-09-24 11:58:42 +02:00
|
|
|
});
|
|
|
|
|
2021-10-19 14:49:06 +02:00
|
|
|
export default CustomWizardNotice;
|