mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:17:08 +08:00
FIX: reload current page when deleting a user
This commit is contained in:
parent
77a775ecd2
commit
b4363de280
|
@ -314,9 +314,10 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
|
||||
destroy: function(opts) {
|
||||
var user = this;
|
||||
var location = document.location.pathname;
|
||||
|
||||
var performDestroy = function(block) {
|
||||
var formData = { context: window.location.pathname };
|
||||
var formData = { context: location };
|
||||
if (block) {
|
||||
formData["block_email"] = true;
|
||||
formData["block_urls"] = true;
|
||||
|
@ -330,7 +331,7 @@ Discourse.AdminUser = Discourse.User.extend({
|
|||
data: formData
|
||||
}).then(function(data) {
|
||||
if (data.deleted) {
|
||||
document.location = "/admin/users/list/active";
|
||||
document.location = location;
|
||||
} else {
|
||||
bootbox.alert(I18n.t("admin.user.delete_failed"));
|
||||
if (data.user) {
|
||||
|
|
|
@ -9,6 +9,10 @@ export default Discourse.Route.extend({
|
|||
bootbox.alert(I18n.t("admin.export_csv.failed"));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
deleteUser: function(user) {
|
||||
Discourse.AdminUser.create(user).destroy({ deletePosts: true });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,10 +98,6 @@ export default ObjectController.extend({
|
|||
postStream.cancelFilter();
|
||||
postStream.refresh();
|
||||
this.close();
|
||||
},
|
||||
|
||||
deleteUser: function(user) {
|
||||
user.destroy({ deletePosts: true });
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user