A-Z browsing

This commit is contained in:
Claude Brisson
2024-02-28 11:37:49 +01:00
parent 57192f166b
commit a13fea13de
4 changed files with 40 additions and 10 deletions

View File

@@ -203,7 +203,7 @@ fun Tournament.Companion.fromJson(json: Json.Object, default: Tournament<*>? = n
shortName = json.getString("shortName") ?: default?.shortName ?: badRequest("missing shortName"),
startDate = json.getString("startDate")?.let { LocalDate.parse(it) } ?: default?.startDate ?: badRequest("missing startDate"),
endDate = json.getString("endDate")?.let { LocalDate.parse(it) } ?: default?.endDate ?: badRequest("missing endDate"),
country = json.getString("country") ?: default?.country ?: badRequest("missing country"),
country = (json.getString("country") ?: default?.country ?: "fr").let { if (it.isEmpty()) "fr" else it },
location = json.getString("location") ?: default?.location ?: badRequest("missing location"),
online = json.getBoolean("online") ?: default?.online ?: false,
komi = json.getDouble("komi") ?: default?.komi ?: 7.5,