Skip to content

Instantly share code, notes, and snippets.

@hiteshchopra11
Created September 14, 2021 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hiteshchopra11/c53460c0843e651b4df90e60e677434d to your computer and use it in GitHub Desktop.
Save hiteshchopra11/c53460c0843e651b4df90e60e677434d to your computer and use it in GitHub Desktop.
get("/notes") {
val notes = db.from(NotesResponse).select().map {
val id = it[NotesEntity.id]
val note = it[NotesEntity.note]
Note(id ?: -1, note ?: "")
}
// Returns the response to the User
call.respond(notes)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment