discourse/app/assets/javascripts/admin/addon/controllers/admin-logs-screened-emails.js

30 lines
713 B
JavaScript
Raw Normal View History

import Controller from "@ember/controller";
import ScreenedEmail from "admin/models/screened-email";
2018-06-15 17:03:24 +02:00
import { exportEntity } from "discourse/lib/export-csv";
import { outputExportResult } from "discourse/lib/export-result";
2014-12-07 09:45:22 +05:30
export default Controller.extend({
loading: false,
actions: {
2018-06-15 17:03:24 +02:00
clearBlock(row) {
row.clearBlock().then(function () {
// feeling lazy
window.location.reload();
});
2014-12-07 09:45:22 +05:30
},
exportScreenedEmailList() {
2018-06-15 17:03:24 +02:00
exportEntity("screened_email").then(outputExportResult);
},
},
show() {
2018-06-15 17:03:24 +02:00
this.set("loading", true);
ScreenedEmail.findAll().then((result) => {
2018-06-15 17:03:24 +02:00
this.set("model", result);
this.set("loading", false);
});
},
});