mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "REFACTOR: support booting discourse with DISCOURSE_NO_CONSTANTS"
This reverts commit c0b277d273.
This commit is contained in:
@@ -1,40 +0,0 @@
|
||||
|
||||
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() {
|
||||
return Discourse.ajax("/admin/dashboard.json").then(function(json) {
|
||||
var model = AdminDashboard.create(json);
|
||||
model.set('loaded', true);
|
||||
return model;
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
Only fetch the list of problems that should be rendered on the dashboard.
|
||||
The model will only have its "problems" attribute set.
|
||||
|
||||
@method fetchProblems
|
||||
@return {jqXHR} a jQuery Promise object
|
||||
**/
|
||||
fetchProblems: function() {
|
||||
return Discourse.ajax("/admin/dashboard/problems.json", {
|
||||
type: 'GET',
|
||||
dataType: 'json'
|
||||
}).then(function(json) {
|
||||
var model = AdminDashboard.create(json);
|
||||
model.set('loaded', true);
|
||||
return model;
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
export default AdminDashboard;
|
||||
Reference in New Issue
Block a user