2018-06-15 23:03:24 +08:00
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2016-06-16 01:49:57 +08:00
|
|
|
|
|
|
|
export default Ember.Controller.extend({
|
|
|
|
actions: {
|
|
|
|
destroy(webhook) {
|
2018-06-15 23:03:24 +08: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(() => {
|
|
|
|
this.get("model").removeObject(webhook);
|
|
|
|
})
|
|
|
|
.catch(popupAjaxError);
|
|
|
|
}
|
2016-06-16 01:49:57 +08:00
|
|
|
}
|
2018-06-15 23:03:24 +08:00
|
|
|
);
|
2016-06-16 01:49:57 +08:00
|
|
|
},
|
|
|
|
|
|
|
|
loadMore() {
|
2018-06-15 23:03:24 +08:00
|
|
|
this.get("model").loadMore();
|
2016-06-16 01:49:57 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|