2020-01-16 12:56:53 -05:00
|
|
|
import EmailPreview, { oneWeekAgo } from "admin/models/email-preview";
|
2019-10-22 09:46:10 -04:00
|
|
|
import DiscourseRoute from "discourse/routes/discourse";
|
2015-11-20 20:27:06 -05:00
|
|
|
|
2019-10-22 09:46:10 -04:00
|
|
|
export default DiscourseRoute.extend({
|
2015-08-16 05:51:31 -04:00
|
|
|
model() {
|
2017-06-28 15:36:34 -04:00
|
|
|
return EmailPreview.findDigest(this.currentUser.get("username"));
|
2015-08-16 05:51:31 -04:00
|
|
|
},
|
|
|
|
|
|
|
|
afterModel(model) {
|
|
|
|
const controller = this.controllerFor("adminEmailPreviewDigest");
|
|
|
|
controller.setProperties({
|
2017-06-28 15:36:34 -04:00
|
|
|
model,
|
|
|
|
username: this.currentUser.get("username"),
|
|
|
|
lastSeen: oneWeekAgo(),
|
2015-08-16 05:51:31 -04:00
|
|
|
showHtml: true,
|
|
|
|
});
|
|
|
|
},
|
|
|
|
});
|