Bind cup reports and linked competition phases to live engine data (by Codex)
This commit is contained in:
1 parent
545e16f153
commit
6b4aa9772d
26 files changed
+402
-33
No files matched your search
@@ -483,6 +483,13 @@ cli::Json ui_read(const ModernState& g, const UiContext& c, const cli::Json& req
|
||||
if (kind == "session") return snapshot(request_id, std::move(m), session_data(g, c));
|
||||
if (kind == "desktop") return snapshot(request_id, std::move(m), desktop_data(g, c, today));
|
||||
if (kind == "camps") return snapshot(request_id, std::move(m), camps_data(g, c, std::to_string(c.state_revision)));
|
||||
if (kind == "other-index" || kind == "other-fixtures") {
|
||||
J data = query_projection(g, c.manager, request);
|
||||
auto* values = std::get_if<O>(&data.value);
|
||||
if (!values || !values->count("ok") || !std::holds_alternative<bool>(values->at("ok").value) || !std::get<bool>(values->at("ok").value))
|
||||
return failure(request_id, "other_reports_unavailable", "Wettbewerb oder Runde ist derzeit nicht verfügbar.", c.state_revision);
|
||||
values->erase("ok"); return snapshot(request_id, std::move(m), std::move(data));
|
||||
}
|
||||
if(kind=="report-index") {
|
||||
A leagues;for(int l=0;l<kLeagueCount;++l)leagues.push_back(report_league(g,l,team_of(g,c.manager)));
|
||||
return snapshot(request_id,std::move(m),O{{"kind","report-index"},{"leagues",std::move(leagues)}});
|
||||
|
||||
Reference in new issue
Block a user