Select all in lists for pair/unpair; allow results changes in previous rounds
This commit is contained in:
@@ -35,6 +35,7 @@ object PairingHandler: PairgothApiHandler {
|
||||
val round = getSubSelector(request)?.toIntOrNull() ?: badRequest("invalid round number")
|
||||
if (round > tournament.lastRound() + 1) badRequest("invalid round: previous round has not been played")
|
||||
val payload = getArrayPayload(request)
|
||||
if (payload.isEmpty()) badRequest("nobody to pair")
|
||||
val allPlayers = payload.size == 1 && payload[0] == "all"
|
||||
//if (!allPlayers && tournament.pairing.type == PairingType.SWISS) badRequest("Swiss pairing requires all pairable players")
|
||||
val playing = (tournament.games(round).values).flatMap {
|
||||
|
@@ -21,7 +21,6 @@ object ResultsHandler: PairgothApiHandler {
|
||||
override fun put(request: HttpServletRequest): Json {
|
||||
val tournament = getTournament(request)
|
||||
val round = getSubSelector(request)?.toIntOrNull() ?: badRequest("invalid round number")
|
||||
if (round != tournament.lastRound()) badRequest("cannot enter results in other rounds but the last")
|
||||
val payload = getObjectPayload(request)
|
||||
val game = tournament.games(round)[payload.getInt("id")] ?: badRequest("invalid game id")
|
||||
game.result = Game.Result.fromSymbol(payload.getChar("result") ?: badRequest("missing result"))
|
||||
|
Reference in New Issue
Block a user