mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-29 18:46:23 -05:00
5c899c765b
This reverts commit c21457d6a7
.
22 lines
572 B
JavaScript
22 lines
572 B
JavaScript
const EmailPreview = Discourse.Model.extend({});
|
|
|
|
EmailPreview.reopenClass({
|
|
findDigest: function(lastSeenAt, username) {
|
|
|
|
if (Em.isEmpty(lastSeenAt)) {
|
|
lastSeenAt = moment().subtract(7, 'days').format('YYYY-MM-DD');
|
|
}
|
|
|
|
if (Em.isEmpty(username)) {
|
|
username = Discourse.User.current().username;
|
|
}
|
|
|
|
return Discourse.ajax("/admin/email/preview-digest.json", {
|
|
data: { last_seen_at: lastSeenAt, username: username }
|
|
}).then(function (result) {
|
|
return EmailPreview.create(result);
|
|
});
|
|
}
|
|
});
|
|
|
|
export default EmailPreview;
|