mercredi 12 mai 2021

Error while executing GET request (Unhandled: GET)

I tried to execute GET request but I got this error.

enter image description here

Bug is obvious here, but I don't know what is a problem.

suspend fun getNotesForUser(email: String) = notes.find(Note::owners contains email).toList()

Here is route code

route("/getNotes") {
    authenticate {
        get {
            val email = call.principal<UserIdPrincipal>()!!.name
            val notes = getNotesForUser(email)
            call.respond(OK, notes)
        }
    }
}

Note class:

data class Note(
val title: String,
val content: String,
val date: Long,
val owners: List<String>,
val color: String,
@BsonId
val id: String = ObjectId().toString()

All of my POST request are working, but this one GET is not.




Aucun commentaire:

Enregistrer un commentaire