From b0be06136d96ea6415457136cb0bffcf9accc150 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Sun, 18 May 2025 13:31:14 +0200 Subject: [PATCH] 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. --- WebsiteBackend/src/de/steamwar/routes/EventFights.kt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/WebsiteBackend/src/de/steamwar/routes/EventFights.kt b/WebsiteBackend/src/de/steamwar/routes/EventFights.kt index 1f0e63c5..bcdb1b6e 100644 --- a/WebsiteBackend/src/de/steamwar/routes/EventFights.kt +++ b/WebsiteBackend/src/de/steamwar/routes/EventFights.kt @@ -68,7 +68,8 @@ data class UpdateEventFight( val spielmodus: String? = null, val map: String? = null, val group: Int? = null, - val spectatePort: Int? = null + val spectatePort: Int? = null, + val ergebnis: Int? = null, ) @Serializable @@ -133,6 +134,11 @@ fun Route.configureEventFightRoutes() { fight.groupId = updateFight.group } } + + if (updateFight.ergebnis != null) { + fight.ergebnis = updateFight.ergebnis + } + fight.update(start, spielmodus, map, teamBlue, teamRed, spectatePort) call.respond(HttpStatusCode.OK, ResponseEventFight(fight)) }