discourse/app/assets/javascripts/admin/routes/admin-email-preview-digest.js.es6
Mark VanLandingham e5311ab645 DEV: Import DiscourseRoute rather than Discourse.Route (#8225)
* DEV: Discourse.Route -> DiscourseRoute with import

* ran prettier on all routes

* prettiered one more file
2019-10-22 09:46:10 -04:00

22 lines
524 B
JavaScript

import DiscourseRoute from "discourse/routes/discourse";
import {
default as EmailPreview,
oneWeekAgo
} from "admin/models/email-preview";
export default DiscourseRoute.extend({
model() {
return EmailPreview.findDigest(this.currentUser.get("username"));
},
afterModel(model) {
const controller = this.controllerFor("adminEmailPreviewDigest");
controller.setProperties({
model,
username: this.currentUser.get("username"),
lastSeen: oneWeekAgo(),
showHtml: true
});
}
});