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

30 lines
708 B
Plaintext
Raw Normal View History

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