discourse/app/assets/javascripts/admin/models/email_log.js.coffee

18 lines
438 B
CoffeeScript
Raw Normal View History

2013-02-05 14:16:51 -05:00
window.Discourse.EmailLog = Discourse.Model.extend({})
window.Discourse.EmailLog.reopenClass
create: (attrs) ->
attrs.user = Discourse.AdminUser.create(attrs.user) if attrs.user
@_super(attrs)
findAll: (filter)->
result = Em.A()
$.ajax
url: "/admin/email_logs.json"
data: {filter: filter}
2013-02-07 10:45:24 -05:00
success: (logs) ->
2013-02-05 14:16:51 -05:00
logs.each (log) -> result.pushObject(Discourse.EmailLog.create(log))
result