diff --git a/api/src/main/kotlin/com/wbrawner/twigs/UserRoutes.kt b/api/src/main/kotlin/com/wbrawner/twigs/UserRoutes.kt index db84fc0..31c01f8 100644 --- a/api/src/main/kotlin/com/wbrawner/twigs/UserRoutes.kt +++ b/api/src/main/kotlin/com/wbrawner/twigs/UserRoutes.kt @@ -126,7 +126,7 @@ fun Application.userRoutes( delete("/{id}") { val session = call.principal()!! // TODO: Add some kind of admin denotation to allow admins to delete other users - val user = userRepository.findAll(call.parameters.getAll("íd")!!).firstOrNull() + val user = userRepository.findAll(call.parameters.entries().first().value).firstOrNull() if (user == null) { errorResponse() return@delete diff --git a/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt b/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt index b930a6e..727d7a3 100644 --- a/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt +++ b/app/src/main/kotlin/com/wbrawner/twigs/server/Application.kt @@ -16,6 +16,7 @@ import kotlinx.coroutines.currentCoroutineContext import kotlinx.coroutines.delay import kotlinx.coroutines.isActive import kotlinx.coroutines.launch +import kotlinx.serialization.json.Json import kotlin.time.Duration import kotlin.time.ExperimentalTime @@ -95,7 +96,15 @@ fun Application.moduleWithDependencies( } } install(ContentNegotiation) { - json() + json(json = Json { + ignoreUnknownKeys = true + encodeDefaults = true + isLenient = true + allowSpecialFloatingPointValues = true + allowStructuredMapKeys = true + prettyPrint = false + useArrayPolymorphism = true + }) } budgetRoutes(budgetRepository, permissionRepository) categoryRoutes(categoryRepository, permissionRepository)