fix: Synchro
parent
1ddc35136a
commit
b27126cac2
|
|
@ -353,8 +353,8 @@ class ObjectBox {
|
|||
});
|
||||
}
|
||||
|
||||
Future<void> DeletePreviousVisitWithoutPhoto() async {
|
||||
final visits = getPreviousVisit();
|
||||
Future<void> DeleteVisitWithoutPhoto() async {
|
||||
final visits = getAllVisit();
|
||||
|
||||
for (final visit in visits) {
|
||||
final photoCount = getVisitPhotoCount(visit.id_visite);
|
||||
|
|
|
|||
|
|
@ -206,6 +206,12 @@ class _SynchronizationPageState extends State<SynchronizationPage>
|
|||
|
||||
final ApiProvider _apiProvider = ApiProvider();
|
||||
|
||||
// upload photo to server
|
||||
await _uploadVisitPhotos(_apiProvider);
|
||||
|
||||
// delete visits without a photo!
|
||||
await objectbox.DeleteVisitWithoutPhoto();
|
||||
|
||||
// synchronous calendar synchronization
|
||||
final syncCalendarResult = await _apiProvider.SyncCalendar();
|
||||
|
||||
|
|
@ -214,19 +220,14 @@ class _SynchronizationPageState extends State<SynchronizationPage>
|
|||
_backofficeSyncCompleted = true;
|
||||
}
|
||||
|
||||
// upload photo to server
|
||||
await _uploadVisitPhotos(_apiProvider);
|
||||
|
||||
final syncLogResult = _syncLog ? await _apiProvider.SyncCalendar() : 'OK';
|
||||
// synchronous logs synchronization
|
||||
final syncLogResult = _syncLog ? await _apiProvider.SyncLog() : 'OK';
|
||||
|
||||
// log synchronization OK ?
|
||||
if (syncLogResult == 'OK') {
|
||||
_logSyncCompleted = true;
|
||||
}
|
||||
|
||||
// delete visits without a photo!
|
||||
await objectbox.DeletePreviousVisitWithoutPhoto();
|
||||
|
||||
// deletes photos that are no longer in any visits
|
||||
await _cleanVisitPhotoDir();
|
||||
|
||||
|
|
|
|||
|
|
@ -174,7 +174,7 @@ class _VisitPhotoTypologyDetailPageState
|
|||
//_shoppingCartCount++;
|
||||
});
|
||||
Fluttertoast.showToast(
|
||||
msg: 'Item has been added to Shopping Cart',
|
||||
msg: 'Item has been added to Shopping Card',
|
||||
toastLength: Toast.LENGTH_LONG);
|
||||
},
|
||||
child: Container(
|
||||
|
|
|
|||
Loading…
Reference in New Issue