2015-09-16 04:45:01 +08:00
|
|
|
function exportEntityByType(type, entity, args) {
|
2015-07-25 00:33:53 +08:00
|
|
|
return Discourse.ajax("/export_csv/export_entity.json", {
|
|
|
|
method: 'POST',
|
2015-09-16 04:45:01 +08:00
|
|
|
data: {entity_type: type, entity, args}
|
2015-07-25 00:33:53 +08:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
export function exportUserArchive() {
|
|
|
|
return exportEntityByType('user', 'user_archive').then(function() {
|
|
|
|
bootbox.alert(I18n.t("admin.export_csv.success"));
|
|
|
|
}).catch(function() {
|
|
|
|
bootbox.alert(I18n.t("admin.export_csv.rate_limit_error"));
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2015-09-16 04:45:01 +08:00
|
|
|
export function exportEntity(entity, args) {
|
|
|
|
return exportEntityByType('admin', entity, args);
|
2015-07-25 00:33:53 +08:00
|
|
|
}
|