mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 02:36:18 +08:00
34 lines
709 B
JavaScript
34 lines
709 B
JavaScript
/**
|
|
Our data model for representing an email log.
|
|
|
|
@class EmailLog
|
|
@extends Discourse.Model
|
|
@namespace Discourse
|
|
@module Discourse
|
|
**/
|
|
Discourse.EmailLog = Discourse.Model.extend({});
|
|
|
|
Discourse.EmailLog.reopenClass({
|
|
create: function(attrs) {
|
|
if (attrs.user) {
|
|
attrs.user = Discourse.AdminUser.create(attrs.user);
|
|
}
|
|
return this._super(attrs);
|
|
},
|
|
|
|
findAll: function(filter) {
|
|
var result = Em.A();
|
|
Discourse.ajax({
|
|
url: Discourse.getURL("/admin/email_logs.json"),
|
|
data: { filter: filter }
|
|
}).then(function(logs) {
|
|
logs.each(function(log) {
|
|
result.pushObject(Discourse.EmailLog.create(log));
|
|
});
|
|
});
|
|
return result;
|
|
}
|
|
});
|
|
|
|
|