diff --git a/src/main/kotlin/de/steamwar/data/Groups.kt b/src/main/kotlin/de/steamwar/data/Groups.kt index 6a71b76..292dbad 100644 --- a/src/main/kotlin/de/steamwar/data/Groups.kt +++ b/src/main/kotlin/de/steamwar/data/Groups.kt @@ -59,5 +59,9 @@ class Groups { newGroup.fights.add(fight) kGroupsFile.writeBytes(Cbor.encodeToByteArray(groups)) } + + fun getAllGroups(): List { + return groups.groups.map { it.name } + } } } \ No newline at end of file diff --git a/src/main/kotlin/de/steamwar/routes/Data.kt b/src/main/kotlin/de/steamwar/routes/Data.kt index e8426c8..47528a7 100644 --- a/src/main/kotlin/de/steamwar/routes/Data.kt +++ b/src/main/kotlin/de/steamwar/routes/Data.kt @@ -1,7 +1,7 @@ package de.steamwar.routes import de.steamwar.ResponseError -import de.steamwar.sql.SQLWrapperImpl +import de.steamwar.data.Groups import de.steamwar.sql.SchematicType import de.steamwar.sql.SteamwarUser import de.steamwar.sql.loadSchematicTypes @@ -50,5 +50,8 @@ fun Routing.configureDataRoutes() { get { call.respondText("Hello World!") } + get("/groups") { + call.respond(Groups.getAllGroups()) + } } } \ No newline at end of file