aboutsummaryrefslogtreecommitdiff
path: root/shared
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-02-07 00:17:49 -0600
committerIván Ávalos <avalos@disroot.org>2022-02-07 00:17:49 -0600
commit8d040f0f02b9462d82fd03041529fdea423f02d3 (patch)
treebb6bd455b9bf2c05424a17aa89c5aba92f8c36e7 /shared
parent7610b6506ee3612413cc0b9636c24aadb05c7119 (diff)
downloadetbsa-trackermap-mobile-8d040f0f02b9462d82fd03041529fdea423f02d3.tar.gz
etbsa-trackermap-mobile-8d040f0f02b9462d82fd03041529fdea423f02d3.tar.bz2
etbsa-trackermap-mobile-8d040f0f02b9462d82fd03041529fdea423f02d3.zip
Added sendCommand() method to CommandsController, and updated Android app to use controller
Diffstat (limited to 'shared')
-rw-r--r--shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
index c483f67..03ba5ab 100644
--- a/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
+++ b/shared/src/commonMain/kotlin/mx/trackermap/TrackerMap/controllers/CommandsController.kt
@@ -10,4 +10,8 @@ class CommandsController(
suspend fun fetchCommands(deviceId: Int): List<Command> {
return commandsApi.commandsGet(deviceId = deviceId).toList()
}
+
+ suspend fun sendCommand(command: Command) {
+ commandsApi.commandsSendPost(command)
+ }
} \ No newline at end of file