Endpoint for live player-scores (new)

This commit is contained in:
Mawoka
2022-09-25 21:38:05 +02:00
parent dc5ec703d0
commit fa7e4774e5
+4 -1
View File
@@ -353,4 +353,7 @@ async def set_next_question(game_pin: int, question_number: int, api_key: str):
@router.get("/live/scores", tags=["live"])
async def get_live_player_scores(game_pin: int):
res = await redis.hgetall(f"game_session:{game_pin}:player_scores")
return res
return_arr = []
for username in res:
return_arr.append({"useranme": username, "score": res[username]})
return return_arr