This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/app/lib/export-csv.js
Robin Ward eab560fe2a
DEV: import I18n instead of global usage (#9768)
Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
Co-authored-by: Robin Ward <robin.ward@gmail.com>

Co-authored-by: Mark VanLandingham <markvanlan@gmail.com>
2020-05-13 16:23:41 -04:00

23 lines
594 B
JavaScript

import I18n from "I18n";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
function exportEntityByType(type, entity, args) {
return ajax("/export_csv/export_entity.json", {
type: "POST",
data: { entity, args }
});
}
export function exportUserArchive() {
return exportEntityByType("user", "user_archive")
.then(function() {
bootbox.alert(I18n.t("user.download_archive.success"));
})
.catch(popupAjaxError);
}
export function exportEntity(entity, args) {
return exportEntityByType("admin", entity, args);
}