Add tags request to NotesService
This commit is contained in:
parent
765f96cedf
commit
468e2dee6f
@ -111,6 +111,12 @@ class NotesService(override val kodein: Kodein) : KodeinAware {
|
||||
db.useTransaction {
|
||||
db.delete(Notes) { it.id eq noteId }
|
||||
}
|
||||
|
||||
fun getTags(userId: Int): List<String> = db.from(Tags)
|
||||
.leftJoin(Notes, on = Tags.noteId eq Notes.id)
|
||||
.select(Tags.name)
|
||||
.where { Notes.userId eq userId }
|
||||
.map { it[Tags.name]!! }
|
||||
}
|
||||
|
||||
data class ChaptersDTO(val title: String, val content: String)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user