Add 'ergebnis' field to EventFights data model and update logic

Introduced a new 'ergebnis' field to the EventFights data model to handle fight results. Updated the logic to support processing and updating this field when provided. This ensures better tracking and management of event fight outcomes.
This commit is contained in:
2025-05-18 13:31:14 +02:00
parent 6e9db276ef
commit b0be06136d
@@ -68,7 +68,8 @@ data class UpdateEventFight(
val spielmodus: String? = null, val spielmodus: String? = null,
val map: String? = null, val map: String? = null,
val group: Int? = null, val group: Int? = null,
val spectatePort: Int? = null val spectatePort: Int? = null,
val ergebnis: Int? = null,
) )
@Serializable @Serializable
@@ -133,6 +134,11 @@ fun Route.configureEventFightRoutes() {
fight.groupId = updateFight.group fight.groupId = updateFight.group
} }
} }
if (updateFight.ergebnis != null) {
fight.ergebnis = updateFight.ergebnis
}
fight.update(start, spielmodus, map, teamBlue, teamRed, spectatePort) fight.update(start, spielmodus, map, teamBlue, teamRed, spectatePort)
call.respond(HttpStatusCode.OK, ResponseEventFight(fight)) call.respond(HttpStatusCode.OK, ResponseEventFight(fight))
} }