Fix userRoutes
This commit is contained in:
parent
4ef2fed502
commit
2900915842
2 changed files with 11 additions and 2 deletions
|
@ -126,7 +126,7 @@ fun Application.userRoutes(
|
|||
delete("/{id}") {
|
||||
val session = call.principal<Session>()!!
|
||||
// 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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue