Migrate Event class to Kotlin and update references across modules

Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
2025-10-29 23:17:17 +01:00
parent 702aa1cfa6
commit eea1073892
10 changed files with 134 additions and 136 deletions
@@ -231,7 +231,7 @@ fun Route.configureEventsRoute() {
}
}
event.update(eventName, deadline, start, end, schemType, maxTeamMembers, publicSchemsOnly)
call.respond(ResponseEvent(Event.get(event.eventID)))
call.respond(ResponseEvent(Event.byId(event.eventID)!!))
}
delete {
val id = call.parameters["id"]?.toIntOrNull()
@@ -239,7 +239,7 @@ fun Route.configureEventsRoute() {
call.respond(HttpStatusCode.BadRequest, ResponseError("Invalid ID"))
return@delete
}
val event = Event.get(id)
val event = Event.byId(id)
if (event == null) {
call.respond(HttpStatusCode.NotFound, ResponseError("Event not found"))
return@delete
@@ -263,7 +263,7 @@ suspend fun ApplicationCall.receiveEvent(fieldName: String = "id"): Event? {
return null
}
val event = Event.get(eventId)
val event = Event.byId(eventId)
if (event == null) {
respond(HttpStatusCode.NotFound, ResponseError("Event not found"))
return null