Better seperation
This commit is contained in:
@@ -7,10 +7,10 @@ import io.ktor.http.*
|
||||
import io.ktor.response.*
|
||||
|
||||
suspend fun ApplicationCall.respondStatus(status: HttpStatusCode) {
|
||||
respond(status, """{"msg": "${status.description}"}""")
|
||||
respond(status, """{"status": "${status.description}"}""")
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the userId for the currently authenticated user
|
||||
*/
|
||||
fun ApplicationCall.userId() = principal<UserDbIdPrincipal>()!!.id
|
||||
fun ApplicationCall.authenticatedUserId() = principal<UserDbIdPrincipal>()!!.id
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
package be.vandewalleh.extensions
|
||||
|
||||
import io.ktor.http.*
|
||||
import java.util.*
|
||||
|
||||
fun Parameters.noteUuid(): UUID {
|
||||
return UUID.fromString(this["noteUuid"])
|
||||
}
|
||||
Reference in New Issue
Block a user