discourse/app/assets/javascripts/admin/addon/controllers/admin-web-hooks.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
674 B
JavaScript
Raw Normal View History

import Controller from "@ember/controller";
2016-06-16 01:49:57 +08:00
import I18n from "I18n";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { inject as service } from "@ember/service";
import { action } from "@ember/object";
2016-06-16 01:49:57 +08:00
export default Controller.extend({
dialog: service(),
2016-06-16 01:49:57 +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
},
});