Lots of things
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
package be.vandewalleh.extensions
|
||||
|
||||
import be.vandewalleh.auth.UserDbIdPrincipal
|
||||
import be.vandewalleh.services.FullNoteCreateDTO
|
||||
import be.vandewalleh.services.FullNotePatchDTO
|
||||
import io.ktor.application.*
|
||||
import io.ktor.auth.*
|
||||
import io.ktor.http.*
|
||||
import io.ktor.request.*
|
||||
import io.ktor.response.*
|
||||
|
||||
suspend fun ApplicationCall.respondStatus(status: HttpStatusCode) {
|
||||
@@ -17,9 +14,3 @@ suspend fun ApplicationCall.respondStatus(status: HttpStatusCode) {
|
||||
* @return the userId for the currently authenticated user
|
||||
*/
|
||||
fun ApplicationCall.userId() = principal<UserDbIdPrincipal>()!!.id
|
||||
|
||||
class NoteCreate(val title: String, val tags: List<String>)
|
||||
|
||||
suspend fun ApplicationCall.receiveNoteCreate(): FullNoteCreateDTO = receive()
|
||||
|
||||
suspend fun ApplicationCall.receiveNotePatch(): FullNotePatchDTO = receive()
|
||||
|
||||
@@ -3,10 +3,6 @@ package be.vandewalleh.extensions
|
||||
import io.ktor.http.*
|
||||
import java.util.*
|
||||
|
||||
fun Parameters.noteTitle(): String {
|
||||
return this["noteTitle"]!!
|
||||
}
|
||||
|
||||
fun Parameters.noteUuid(): UUID {
|
||||
return UUID.fromString(this["noteUuid"])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user