2019-10-24 01:06:54 +08:00
|
|
|
import Controller from "@ember/controller";
|
2016-06-16 01:49:57 +08:00
|
|
|
import I18n from "I18n";
|
|
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
2022-09-14 23:06:56 +08:00
|
|
|
import { inject as service } from "@ember/service";
|
|
|
|
import { action } from "@ember/object";
|
2016-06-16 01:49:57 +08:00
|
|
|
|
2019-10-24 01:06:54 +08:00
|
|
|
export default Controller.extend({
|
2022-09-14 23:06:56 +08:00
|
|
|
dialog: service(),
|
2016-06-16 01:49:57 +08:00
|
|
|
|
2022-09-14 23:06:56 +08:00
|
|
|
@action
|
|
|
|
destroy(webhook) {
|
|
|
|
return this.dialog.yesNoConfirm({
|
|
|
|
message: I18n.t("admin.web_hooks.delete_confirm"),
|
|
|
|
didConfirm: () => {
|
|
|
|
webhook
|
|
|
|
.destroyRecord()
|
|
|
|
.then(() => {
|
|
|
|
this.model.removeObject(webhook);
|
|
|
|
})
|
|
|
|
.catch(popupAjaxError);
|
|
|
|
},
|
|
|
|
});
|
|
|
|
},
|
|
|
|
|
|
|
|
@action
|
|
|
|
loadMore() {
|
|
|
|
this.model.loadMore();
|
2016-06-16 01:49:57 +08:00
|
|
|
},
|
|
|
|
});
|