mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #2993 from techAPJ/patch-4
Return a promise instead of triggering bootbox in model
This commit is contained in:
commit
953ac7de8f
2 changed files with 8 additions and 8 deletions
|
@ -15,13 +15,7 @@ Discourse.ExportCsv.reopenClass({
|
|||
@method export_user_list
|
||||
**/
|
||||
exportUserList: function() {
|
||||
return Discourse.ajax("/admin/export_csv/users.json").then(function(result) {
|
||||
if (result.success) {
|
||||
bootbox.alert(I18n.t("admin.export_csv.success"));
|
||||
} else {
|
||||
bootbox.alert(I18n.t("admin.export_csv.failed"));
|
||||
}
|
||||
});
|
||||
return Discourse.ajax("/admin/export_csv/users.json");
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,13 @@ Discourse.AdminUsersListRoute = Discourse.Route.extend({
|
|||
|
||||
actions: {
|
||||
exportUsers: function() {
|
||||
Discourse.ExportCsv.exportUserList();
|
||||
Discourse.ExportCsv.exportUserList().then(function(result) {
|
||||
if (result.success) {
|
||||
bootbox.alert(I18n.t("admin.export_csv.success"));
|
||||
} else {
|
||||
bootbox.alert(I18n.t("admin.export_csv.failed"));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue