2019-11-08 14:13:35 -05:00
|
|
|
import EmberObject from "@ember/object";
|
2020-05-13 16:23:41 -04:00
|
|
|
import I18n from "I18n";
|
2016-06-30 13:55:44 -04:00
|
|
|
import { ajax } from "discourse/lib/ajax";
|
2019-11-08 14:13:35 -05:00
|
|
|
import discourseComputed from "discourse-common/utils/decorators";
|
2019-04-26 06:16:21 -04:00
|
|
|
|
2019-11-08 14:13:35 -05:00
|
|
|
const ScreenedEmail = EmberObject.extend({
|
2019-11-07 16:38:28 -05:00
|
|
|
@discourseComputed("action")
|
2019-04-26 06:16:21 -04:00
|
|
|
actionName(action) {
|
|
|
|
return I18n.t("admin.logs.screened_actions." + action);
|
|
|
|
},
|
2014-06-02 02:52:43 -04:00
|
|
|
|
2021-11-13 08:01:55 -05:00
|
|
|
clearBlock() {
|
2019-05-27 04:15:39 -04:00
|
|
|
return ajax("/admin/logs/screened_emails/" + this.id, {
|
2020-03-26 16:00:10 -04:00
|
|
|
type: "DELETE",
|
2016-06-30 13:55:44 -04:00
|
|
|
});
|
2014-06-02 02:52:43 -04:00
|
|
|
},
|
2013-08-14 16:40:12 -04:00
|
|
|
});
|
|
|
|
|
2015-11-20 20:27:06 -05:00
|
|
|
ScreenedEmail.reopenClass({
|
2021-11-13 08:01:55 -05:00
|
|
|
findAll() {
|
2016-06-30 13:55:44 -04: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-20 20:27:06 -05:00
|
|
|
return ScreenedEmail.create(b);
|
2013-08-14 16:40:12 -04:00
|
|
|
});
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|
2015-11-20 20:27:06 -05:00
|
|
|
|
|
|
|
export default ScreenedEmail;
|