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