Pairables list in progress

This commit is contained in:
Claude Brisson
2023-12-21 10:37:16 +01:00
parent fdcdd9c1a9
commit ea9e298330
11 changed files with 166 additions and 36 deletions

View File

@@ -16,6 +16,7 @@ object PairingHandler: PairgothApiHandler {
override fun get(request: HttpServletRequest, response: HttpServletResponse): Json? {
val tournament = getTournament(request)
val round = getSubSelector(request)?.toIntOrNull() ?: badRequest("invalid round number")
if (round > tournament.lastRound() + 1) badRequest("invalid round: previous round has not been played")
val playing = tournament.games(round).values.flatMap {
listOf(it.black, it.white)
}.toSet()