diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt index f570442..8629a5f 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiCommandRoutes.kt @@ -56,7 +56,7 @@ fun Routing.apiCommandRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") @@ -89,7 +89,7 @@ fun Routing.apiCommandRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") @@ -127,7 +127,7 @@ fun Routing.apiCommandRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiDiscordRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiDiscordRoutes.kt index c0f6637..69e67f0 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiDiscordRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiDiscordRoutes.kt @@ -32,7 +32,7 @@ fun Route.apiDiscordRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") @@ -65,7 +65,7 @@ fun Route.apiDiscordRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt index c90637a..c7b9046 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiRoutes.kt @@ -120,7 +120,7 @@ fun Routing.apiRoutes() { )) val subordinates = transaction { - user.subordinates.copy() + user.subordinates.toList() } returnUsers.addAll(subordinates.map { val subStatus = it.token?.let { token -> ChzzkUserCache.getCachedUser(token) } diff --git a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiTimerRoutes.kt b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiTimerRoutes.kt index 97f2291..6264545 100644 --- a/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiTimerRoutes.kt +++ b/webserver/src/main/kotlin/space/mori/chzzk_bot/webserver/routes/ApiTimerRoutes.kt @@ -29,7 +29,7 @@ fun Routing.apiTimerRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist") @@ -56,7 +56,7 @@ fun Routing.apiTimerRoutes() { } val managers = transaction { - user.managers.copy() + user.managers.toList() } if(!managers.any { it.naverId == session?.id } && user.naverId != session?.id) { call.respond(HttpStatusCode.BadRequest, "User does not exist")