discourse/app/assets/javascripts/admin/controllers/admin-web-hooks.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
664 B
JavaScript
Raw Normal View History

import I18n from "I18n";
import Controller from "@ember/controller";
2016-06-15 13:49:57 -04:00
import { popupAjaxError } from "discourse/lib/ajax-error";
export default Controller.extend({
2016-06-15 13:49:57 -04:00
actions: {
destroy(webhook) {
return bootbox.confirm(
I18n.t("admin.web_hooks.delete_confirm"),
I18n.t("no_value"),
I18n.t("yes_value"),
result => {
if (result) {
webhook
.destroyRecord()
.then(() => {
this.model.removeObject(webhook);
2016-06-15 13:49:57 -04:00
})
.catch(popupAjaxError);
2018-06-15 11:03:24 -04:00
}
2016-06-15 13:49:57 -04:00
}
);
},
loadMore() {
this.model.loadMore();
2016-06-15 13:49:57 -04:00
}
}
});