mirror of
https://github.com/discourse/discourse.git
synced 2024-12-15 21:13:53 +08:00
eab560fe2a
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com> Co-authored-by: Robin Ward <robin.ward@gmail.com> Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
30 lines
664 B
JavaScript
30 lines
664 B
JavaScript
import I18n from "I18n";
|
|
import Controller from "@ember/controller";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
export default Controller.extend({
|
|
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);
|
|
})
|
|
.catch(popupAjaxError);
|
|
}
|
|
}
|
|
);
|
|
},
|
|
|
|
loadMore() {
|
|
this.model.loadMore();
|
|
}
|
|
}
|
|
});
|