0
0
Fork 1
Spiegel von https://github.com/paviliondev/discourse-custom-wizard.git synchronisiert 2024-11-10 12:22:54 +01:00
discourse-custom-wizard/assets/javascripts/discourse/controllers/admin-wizards.js.es6
angusmcleod 084c6f4a7a wip
2021-09-24 17:58:42 +08:00

20 Zeilen
Kein EOL
541 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);
}
}
});