`/home` endpoint should details about joined games that are still pending
aaronpolhamus opened this issue · comments
FYI @ruidovisual
When a user joins a game, we want that game to continue to show up on the user's home page, even if its status is still pending (e.g. because we are waiting on decisions from other users). Currently when a user joins a game it disappears from her inventory of game statuses returned by the /home
endpoint.
This is good to go now. The new response schema from /home
is as follows:
{
"email": <str>,
"id": <int> (user Id),
"name": <str>,
"profile_pic": <str>,
"username": <str>,
"game_info": <ARRAY> [
{
"creator_id": <int>,
"game_id": <int>,
"game_status": <str: "pending", "active">,
"invite_status": <str: "joined", "accepted">,
"title": <str>
"users": <ARRAY> [<int>]
}
]
}
test example for backend API calls here:
stock-bets/backend/tests/test_api.py
Line 476 in a1151f1
By rendering current/invited games lists inside a useEffect
that is linked to game invite responses it should be pretty straightforward to have this be as responsive as accepting friend invites :)