Files
discourse-chat-integration/assets/javascripts/admin/components/rule-row.js
T
2022-03-06 21:18:46 +01:00

32 lines
622 B
JavaScript

import Component from "@ember/component";
import { popupAjaxError } from "discourse/lib/ajax-error";
import computed from "discourse-common/utils/decorators";
export default Component.extend({
tagName: "tr",
@computed("rule.type")
isCategory(type) {
return type === "normal";
},
@computed("rule.type")
isMessage(type) {
return type === "group_message";
},
@computed("rule.type")
isMention(type) {
return type === "group_mention";
},
actions: {
delete(rule) {
rule
.destroyRecord()
.then(() => this.refresh())
.catch(popupAjaxError);
},
},
});