mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 19:15:04 +08:00
28 lines
601 B
JavaScript
28 lines
601 B
JavaScript
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
|
|
export default Ember.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();
|
|
}
|
|
}
|
|
});
|