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",
|
|
|
|
})
|
2021-10-19 14:49:06 +02:00
|
|
|
.then((result) => {
|
2021-09-24 11:58:42 +02:00
|
|
|
if (result.success) {
|
|
|
|
const notices = this.notices;
|
2021-10-19 14:49:06 +02:00
|
|
|
notices.removeObject(notices.findBy("id", noticeId));
|
2021-09-24 11:58:42 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
.catch(popupAjaxError);
|
2021-10-19 14:49:06 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
});
|