feat(ui): add MVP host/player web screens
This commit is contained in:
@@ -133,6 +133,22 @@ def session_detail(request: HttpRequest, code: str) -> JsonResponse:
|
||||
)
|
||||
)
|
||||
|
||||
current_round_question = (
|
||||
RoundQuestion.objects.filter(session=session, round_number=session.current_round)
|
||||
.select_related("question")
|
||||
.order_by("-id")
|
||||
.first()
|
||||
)
|
||||
|
||||
round_question_payload = None
|
||||
if current_round_question:
|
||||
round_question_payload = {
|
||||
"id": current_round_question.id,
|
||||
"round_number": current_round_question.round_number,
|
||||
"prompt": current_round_question.question.prompt,
|
||||
"shown_at": current_round_question.shown_at.isoformat(),
|
||||
}
|
||||
|
||||
return JsonResponse(
|
||||
{
|
||||
"session": {
|
||||
@@ -143,6 +159,7 @@ def session_detail(request: HttpRequest, code: str) -> JsonResponse:
|
||||
"players_count": len(players),
|
||||
},
|
||||
"players": players,
|
||||
"round_question": round_question_payload,
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user