Standings handler default round is the last

This commit is contained in:
Claude Brisson
2024-08-22 18:28:49 +02:00
parent fd5c0235fe
commit ee9ce53f82

View File

@@ -27,7 +27,7 @@ import kotlin.collections.ArrayList
object StandingsHandler: PairgothApiHandler {
override fun get(request: HttpServletRequest, response: HttpServletResponse): Json? {
val tournament = getTournament(request)
val round = getSubSelector(request)?.toIntOrNull() ?: ApiHandler.badRequest("invalid round number")
val round = getSubSelector(request)?.toIntOrNull() ?: tournament.rounds
val includePreliminary = request.getParameter("include_preliminary")?.let { it.toBoolean() } ?: false
val sortedPairables = tournament.getSortedPairables(round, includePreliminary)