Merge pull request #2993 from techAPJ/patch-4

Return a promise instead of triggering bootbox in model
This commit is contained in:
Robin Ward 2014-11-21 15:20:50 -05:00
commit 953ac7de8f
2 changed files with 8 additions and 8 deletions

View file

@ -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");
},
/**

View file

@ -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"));
}
});
}
}
});