1
0
Fork 0
discourse-custom-wizard-unl.../assets/javascripts/discourse/controllers/admin-wizards.js.es6

20 Zeilen
541 B
Text

2021-09-24 11:58:42 +02:00
import Controller from "@ember/controller";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { ajax } from "discourse/lib/ajax";
export default Controller.extend({
actions: {
dismissNotice(noticeId) {
ajax(`/admin/wizards/notice/${this.id}`, {
type: "DELETE",
})
.then(result => {
if (result.success) {
const notices = this.notices;
notices.removeObject(notices.findBy('id', noticeId));
}
})
.catch(popupAjaxError);
}
}
});