diff --git a/api/src/features/ContentNegotiationFeature.kt b/api/src/features/ContentNegotiationFeature.kt index 3b91178..8906914 100644 --- a/api/src/features/ContentNegotiationFeature.kt +++ b/api/src/features/ContentNegotiationFeature.kt @@ -7,8 +7,6 @@ import io.ktor.jackson.* fun Application.contentNegotiationFeature() { install(ContentNegotiation) { - jackson { - enable(SerializationFeature.INDENT_OUTPUT) - } + jackson {} } } \ No newline at end of file diff --git a/api/src/services/NotesService.kt b/api/src/services/NotesService.kt index 1f31991..f89c829 100644 --- a/api/src/services/NotesService.kt +++ b/api/src/services/NotesService.kt @@ -25,19 +25,14 @@ class NotesService(override val kodein: Kodein) : KodeinAware { .where { Notes.userId eq userId } .orderBy(Notes.updatedAt.desc()) .map { row -> - Notes.createEntity(row) - } - .toList() - .map { note -> val tags = db.from(Tags) .select(Tags.name) - .where { Tags.noteId eq note.id } + .where { Tags.noteId eq row[Notes.id]!! } .map { it[Tags.name]!! } - .toList() - val updatedAt = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(note.updatedAt) + val updatedAt = DateTimeFormatter.ISO_LOCAL_DATE_TIME.format(row[Notes.updatedAt]!!) - NotesDTO(note.title, tags, updatedAt) + NotesDTO(row[Notes.title]!!, tags, updatedAt) } fun getNoteIdFromUserIdAndTitle(userId: Int, noteTitle: String): Int? = db.from(Notes)