REFACTOR: Remove Discourse.Ajax

This commit is contained in:
Robin Ward
2016-06-30 13:55:44 -04:00
parent 56f07529bb
commit b8125b3512
111 changed files with 567 additions and 549 deletions

View File

@ -1,3 +1,4 @@
import { ajax } from 'discourse/lib/ajax';
const AdminDashboard = Discourse.Model.extend({});
@ -11,7 +12,7 @@ AdminDashboard.reopenClass({
@return {jqXHR} a jQuery Promise object
**/
find: function() {
return Discourse.ajax("/admin/dashboard.json").then(function(json) {
return ajax("/admin/dashboard.json").then(function(json) {
var model = AdminDashboard.create(json);
model.set('loaded', true);
return model;
@ -26,7 +27,7 @@ AdminDashboard.reopenClass({
@return {jqXHR} a jQuery Promise object
**/
fetchProblems: function() {
return Discourse.ajax("/admin/dashboard/problems.json", {
return ajax("/admin/dashboard/problems.json", {
type: 'GET',
dataType: 'json'
}).then(function(json) {