mirror of
https://github.com/discourse/discourse.git
synced 2025-06-03 02:48:28 +08:00
REFACTOR: Remove Discourse.Ajax
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { ajax } from 'discourse/lib/ajax';
|
||||
|
||||
export default Ember.Component.extend({
|
||||
classNames: ["ip-lookup"],
|
||||
@ -23,7 +24,7 @@ export default Ember.Component.extend({
|
||||
this.set("show", true);
|
||||
|
||||
if (!this.get("location")) {
|
||||
Discourse.ajax("/admin/users/ip-info", {
|
||||
ajax("/admin/users/ip-info", {
|
||||
data: { ip: this.get("ip") }
|
||||
}).then(function (location) {
|
||||
self.set("location", Em.Object.create(location));
|
||||
@ -39,7 +40,7 @@ export default Ember.Component.extend({
|
||||
"order": "trust_level DESC"
|
||||
};
|
||||
|
||||
Discourse.ajax("/admin/users/total-others-with-same-ip", { data }).then(function (result) {
|
||||
ajax("/admin/users/total-others-with-same-ip", { data }).then(function (result) {
|
||||
self.set("totalOthersWithSameIP", result.total);
|
||||
});
|
||||
|
||||
@ -67,7 +68,7 @@ export default Ember.Component.extend({
|
||||
totalOthersWithSameIP: null
|
||||
});
|
||||
|
||||
Discourse.ajax("/admin/users/delete-others-with-same-ip.json", {
|
||||
ajax("/admin/users/delete-others-with-same-ip.json", {
|
||||
type: "DELETE",
|
||||
data: {
|
||||
"ip": self.get("ip"),
|
||||
|
Reference in New Issue
Block a user