aboutsummaryrefslogtreecommitdiff
path: root/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt15
1 files changed, 7 insertions, 8 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt
index e120e97..bc0a48f 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/ReportController.kt
@@ -60,18 +60,17 @@ class ReportController(
return
}
- val (currentDate, previousDate) = reportPeriod.getDates()
+ val (from, to) = reportPeriod.getStringDates()
if (!xlsx) {
reportFlow.value = Report.LoadingReport
}
- // GlobalScope.launch {
- when (reportType) {
- ReportType.POSITIONS -> fetchPositions(deviceId, previousDate, currentDate, xlsx)
- ReportType.EVENTS -> fetchEvents(deviceId, previousDate, currentDate, eventTypes, xlsx)
- ReportType.STOPS -> fetchStops(deviceId, previousDate, currentDate, xlsx)
- }
- // }
+
+ when (reportType) {
+ ReportType.POSITIONS -> fetchPositions(deviceId, from, to, xlsx)
+ ReportType.EVENTS -> fetchEvents(deviceId, from, to, eventTypes, xlsx)
+ ReportType.STOPS -> fetchStops(deviceId, from, to, xlsx)
+ }
}
private suspend fun fetchPositions(