Spiegel von
https://github.com/paviliondev/discourse-custom-wizard.git
synchronisiert 2024-11-29 20:20:29 +01:00
20 Zeilen
546 B
JavaScript
20 Zeilen
546 B
JavaScript
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);
|
|
},
|
|
},
|
|
});
|