mirror of
https://github.com/discourse/discourse.git
synced 2024-12-14 07:33:39 +08:00
30 lines
674 B
JavaScript
30 lines
674 B
JavaScript
import Controller from "@ember/controller";
|
|
import I18n from "I18n";
|
|
import { popupAjaxError } from "discourse/lib/ajax-error";
|
|
import { inject as service } from "@ember/service";
|
|
import { action } from "@ember/object";
|
|
|
|
export default Controller.extend({
|
|
dialog: service(),
|
|
|
|
@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();
|
|
},
|
|
});
|