mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-24 16:18:42 -05:00
5c899c765b
This reverts commit c21457d6a7
.
30 lines
660 B
JavaScript
30 lines
660 B
JavaScript
import AdminUser from 'admin/models/admin-user';
|
|
|
|
const EmailLog = Discourse.Model.extend({});
|
|
|
|
EmailLog.reopenClass({
|
|
|
|
create: function(attrs) {
|
|
attrs = attrs || {};
|
|
|
|
if (attrs.user) {
|
|
attrs.user = AdminUser.create(attrs.user);
|
|
}
|
|
|
|
return this._super(attrs);
|
|
},
|
|
|
|
findAll: function(filter) {
|
|
filter = filter || {};
|
|
var status = filter.status || "all";
|
|
filter = _.omit(filter, "status");
|
|
|
|
return Discourse.ajax("/admin/email/" + status + ".json", { data: filter }).then(function(logs) {
|
|
return _.map(logs, function (log) {
|
|
return EmailLog.create(log);
|
|
});
|
|
});
|
|
}
|
|
});
|
|
|
|
export default EmailLog;
|