package be.vandewalleh.controllers import be.vandewalleh.controllers.base.AuthCrudController import be.vandewalleh.services.NotesService import io.ktor.application.call import io.ktor.response.respond import io.ktor.routing.Routing import io.ktor.routing.get import org.kodein.di.Kodein import org.kodein.di.generic.instance class NotesController(kodein: Kodein) : AuthCrudController("/notes", kodein) { private val notesService by kodein.instance() override fun Routing.registerAuthRoutes() { get { val userId = call.userId() val notes = notesService.getNotes(userId) call.respond(notes) } } }