Skip to content

Commit

Permalink
No longer convert Flows to List before responding
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed May 30, 2023
1 parent e861f6a commit 62c2230
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -35,11 +34,11 @@ fun Route.sounds() {
}

get<Tags> { (query, limit) ->
call.respond(SoundBoardDatabase.sounds.findAllTags(query, limit).toList())
call.respond(SoundBoardDatabase.sounds.findAllTags(query, limit))
}

get<Sounds.ListSounds> { (onlyMine, queryString) ->
call.respond(SoundBoardDatabase.sounds.search(queryString, onlyMine, call.userId).toList())
call.respond(SoundBoardDatabase.sounds.search(queryString, onlyMine, call.userId))
}

authenticated {
Expand Down

0 comments on commit 62c2230

Please sign in to comment.