add minimal errorcheck
parent
0e49b9cd32
commit
7bc9d4f35d
|
@ -1,4 +1,3 @@
|
|||
import 'package:smoke_cess_app/interface/db_record.dart';
|
||||
import 'package:smoke_cess_app/models/mood.dart';
|
||||
import 'package:smoke_cess_app/models/relapse.dart';
|
||||
import 'package:smoke_cess_app/models/sleep.dart';
|
||||
|
|
|
@ -31,13 +31,13 @@ class ExportService {
|
|||
};
|
||||
}
|
||||
|
||||
void exportData() async {
|
||||
Future<int> exportData() async {
|
||||
Map<String, List<String>> body = await _loadRecords();
|
||||
final response = await http.post(url,
|
||||
headers: <String, String>{
|
||||
'Content-Type': 'application/json; charset=UTF-8',
|
||||
},
|
||||
body: jsonEncode(body));
|
||||
print(response.statusCode);
|
||||
return response.statusCode >= 400 ? 0 : 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue