mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 15:15:07 +00:00
return a promise instead of triggering bootbox in model
This commit is contained in:
parent
304b96aa81
commit
428b71687f
@ -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…
x
Reference in New Issue
Block a user