discourse/app/assets/javascripts/admin/models/admin-dashboard.js.es6

23 lines
575 B
Plaintext
Raw Normal View History

2018-06-15 11:03:24 -04:00
import { ajax } from "discourse/lib/ajax";
const AdminDashboard = Discourse.Model.extend({});
AdminDashboard.reopenClass({
/**
Fetch all dashboard data. This can be an expensive request when the cached data
has expired and the server must collect the data again.
@method find
@return {jqXHR} a jQuery Promise object
**/
find: function() {
2016-06-30 13:55:44 -04:00
return ajax("/admin/dashboard.json").then(function(json) {
var model = AdminDashboard.create(json);
2018-06-15 11:03:24 -04:00
model.set("loaded", true);
return model;
});
2018-06-15 11:03:24 -04:00
}
});
export default AdminDashboard;