forked from SteamWar/SteamWar
Migrate Event class to Kotlin and update references across modules
Signed-off-by: Chaoscaot <max@maxsp.de>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user