mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: reload current page when deleting a user
This commit is contained in:
parent
77a775ecd2
commit
b4363de280
3 changed files with 7 additions and 6 deletions
|
@ -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 a new issue