From 62c22309db818e0e0a2c6f0cb5793d3447d28802 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 30 May 2023 19:59:39 +0200 Subject: [PATCH] No longer convert Flows to List before responding --- .../kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt b/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt index 0d8672d..c5c7446 100644 --- a/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt +++ b/bot/src/main/kotlin/dev/schlaubi/tonbrett/bot/server/SoundsRoute.kt @@ -20,7 +20,6 @@ import io.ktor.server.application.* import io.ktor.server.resources.* import io.ktor.server.response.* import io.ktor.server.routing.Route -import kotlinx.coroutines.flow.toList @OptIn(KordUnsafe::class, KordExperimental::class) fun Route.sounds() { @@ -35,11 +34,11 @@ fun Route.sounds() { } get { (query, limit) -> - call.respond(SoundBoardDatabase.sounds.findAllTags(query, limit).toList()) + call.respond(SoundBoardDatabase.sounds.findAllTags(query, limit)) } get { (onlyMine, queryString) -> - call.respond(SoundBoardDatabase.sounds.search(queryString, onlyMine, call.userId).toList()) + call.respond(SoundBoardDatabase.sounds.search(queryString, onlyMine, call.userId)) } authenticated {