aaronpolhamus / stock-bets

fantasy football for stocks

Home Page:https://stockbets.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`/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:

def test_home_page(self):

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 :)