Migrated to nuxt-js frontend framework

This commit is contained in:
2020-04-17 18:57:05 +02:00
parent 8fe229b3d6
commit 1917e2e9fc
32 changed files with 8446 additions and 15 deletions
+2 -2
View File
@@ -38,10 +38,10 @@ fun Application.module() {
log.debug(kodein.container.tree.bindings.description())
// TODO, clean this (migration)
val feature: Feature by kodein.instance()
val feature by kodein.instance<Feature>()
feature.execute()
val controllers: Set<KodeinController> by kodein.instance()
val controllers by kodein.instance<Set<KodeinController>>()
routing {
controllers.forEach {
+16 -13
View File
@@ -39,21 +39,24 @@ class NoteController(kodein: Kodein) : KodeinController(kodein) {
.find { Users.email eq email }
?: return@post call.respond(HttpStatusCode.Forbidden, ApiError.DeletedUserError)
val transaction = db.useTransaction {
val note = Note {
this.title = body.title
this.content = body.content
this.user = user
}
db.sequenceOf(Notes).add(note)
body.tags.forEach { tagName ->
val tag = Tag {
this.name = tagName
this.note = note
val note = Note {
this.title = body.title
this.content = body.content
this.user = user
}
db.sequenceOf(Tags).add(tag)
db.sequenceOf(Notes).add(note)
body.tags.forEach { tagName ->
val tag = Tag {
this.name = tagName
this.note = note
}
db.sequenceOf(Tags).add(tag)
}
1
}
return@post call.respond(Response("created"))