feat: new last_goal_for endpoint, simple_select_all improvements

also introduces sample usage for the new endpoint in lewy_routes
This commit is contained in:
2025-06-03 02:38:13 +02:00
parent 4987dc4cf7
commit 3b9aa8150b
3 changed files with 73 additions and 4 deletions

View File

@@ -105,6 +105,20 @@ def debugger_halt(r):
breakpoint()
return 200, "ok", []
def last_goal_for(sportowiec: str = "MVC8zHZD"):
"""
Pobierz klub, dla którego sportowiec (domyślnie Robert) oddał ostatni gol.
:returns: Klub, lub None
:rtype: kluby | None
"""
sportowiec = getDb().simple_select_all("sportowcy", zewnetrzne_id_zawodnika=sportowiec)
if sportowiec != []:
return sportowiec[0].ostatni_gol_dla
return None
def lookup(data, request):
"""
Obsługuje zapytania zwrócone do /api/v1/...