CSV export

This commit is contained in:
Hillel Coren 2022-05-20 12:14:29 +03:00
parent 21755fa14c
commit fcd42476fb
1 changed files with 14 additions and 2 deletions

View File

@ -162,12 +162,24 @@ class _ImportExportState extends State<ImportExport> {
final webClient = WebClient();
final state = StoreProvider.of<AppState>(context).state;
final credentials = state.credentials;
final url = '${credentials.url}/export';
String url = credentials.url;
if (_exportFormat == ImportType.json) {
url = '$url/export';
} else {
url = '$url/reports/$_exportType';
}
setState(() => _isExporting = true);
webClient
.post(url, credentials.token)
.post(url, credentials.token,
data: json.encode(
{
'send_email': true,
//'report_keys': <String>[],
},
))
.then((dynamic result) {
setState(() => _isExporting = false);
showMessageDialog(