2019-11-07 15:38:28 -06:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2018-06-15 17:03:24 +02:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2019-11-08 14:13:35 -05:00
|
|
|
import EmberObject from "@ember/object";
|
2019-04-26 12:16:21 +02:00
|
|
|
|
2019-11-08 14:13:35 -05:00
|
|
|
const ScreenedEmail = EmberObject.extend({
|
2019-11-07 15:38:28 -06:00
|
|
|
@discourseComputed("action")
|
2019-04-26 12:16:21 +02:00
|
|
|
actionName(action) {
|
|
|
|
return I18n.t("admin.logs.screened_actions." + action);
|
|
|
|
},
|
2014-06-02 16:52:43 +10:00
|
|
|
|
|
|
|
clearBlock: function() {
|
2019-05-27 10:15:39 +02:00
|
|
|
return ajax("/admin/logs/screened_emails/" + this.id, {
|
2020-03-26 21:00:10 +01:00
|
|
|
type: "DELETE"
|
2018-06-15 17:03:24 +02:00
|
|
|
});
|
2014-06-02 16:52:43 +10:00
|
|
|
}
|
2013-08-14 16:40:12 -04:00
|
|
|
});
|
|
|
|
|
2015-11-21 12:27:06 +11:00
|
|
|
ScreenedEmail.reopenClass({
|
2013-12-30 13:29:52 -05:00
|
|
|
findAll: function() {
|
2018-06-15 17:03:24 +02:00
|
|
|
return ajax("/admin/logs/screened_emails.json").then(function(
|
|
|
|
screened_emails
|
|
|
|
) {
|
2013-08-14 16:40:12 -04:00
|
|
|
return screened_emails.map(function(b) {
|
2015-11-21 12:27:06 +11:00
|
|
|
return ScreenedEmail.create(b);
|
2013-08-14 16:40:12 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
2015-11-21 12:27:06 +11:00
|
|
|
|
|
|
|
export default ScreenedEmail;
|