Dieser Commit ist enthalten in:
Chaoscaot 2023-02-15 20:53:12 +01:00
Ursprung 989f05395a
Commit f4099ae2b1

Datei anzeigen

@ -129,13 +129,13 @@ fun Routing.configureEventsRoute() {
val blue = Team.get(it.teamBlue)
val red = Team.get(it.teamRed)
val winner = if (it.ergebnis == 1) blue.teamName else if(it.ergebnis == 2) red.teamName else if(it.ergebnis == 3) "Tie" else "Unknown"
csv.append(arrayOf(it.startTime.toString(), Team.get(it.teamBlue).teamName, Team.get(it.teamRed).teamName, winner, Groups.getGroup(it.fightID) ?: "Ungrouped").joinToString(","))
csv.append(arrayOf(it.startTime.toString(), Team.get(it.teamBlue).teamName, Team.get(it.teamRed).teamName, winner, Groups.getGroup(it.fightID)?.name ?: "Ungrouped").joinToString(","))
}
call.response.header("Content-Disposition", "attachment; filename=\"${event.eventName}.csv\"")
call.response.header("Content-Type", "text/csv")
call.response.header("Content-Transfer-Encoding", "binary")
call.response.header("Pragma", "no-cache")
call.respondText(csv.toString(), ContentType.Text.Plain, HttpStatusCode.OK)
call.respondText(csv.toString())
}
put {
val id = call.parameters["id"]?.toIntOrNull()