mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-28 01:56:01 -05:00
35 lines
723 B
JavaScript
35 lines
723 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;
|
|
result = Em.A();
|
|
jQuery.ajax({
|
|
url: "/admin/email_logs.json",
|
|
data: { filter: filter },
|
|
success: function(logs) {
|
|
logs.each(function(log) {
|
|
result.pushObject(Discourse.EmailLog.create(log));
|
|
});
|
|
}
|
|
});
|
|
return result;
|
|
}
|
|
});
|
|
|
|
|