Skip to content
This repository has been archived by the owner on Oct 2, 2018. It is now read-only.

Why does everything in the API return a game? #37

Open
kenan-rhoton opened this issue Mar 1, 2018 · 8 comments
Open

Why does everything in the API return a game? #37

kenan-rhoton opened this issue Mar 1, 2018 · 8 comments
Assignees
Labels

Comments

@kenan-rhoton
Copy link
Owner

Currently we have 4 API calls:

  • POST to /games: Returns an entire game-as-player object, when only the game-id and player-id are needed.
  • POST to /games/:game-id/: Returns an entire game-as-player object when only player-id or error are needed.
  • POST to /games/:game-id/player/:player-id: Returns (guess what?) and entire game-as-player object when only ok or error are needed. Also, this should be a PUT call (my bad).
  • GET to /games/:game-id/player/:player-id: Returns an entire game-as-player which is exactly what we want.

So 3 of the 4 calls return unnecessary stuff and on top of that actually require specific logic to implement returning this unnecessary stuff (save-game has an extra line *just to return the saved-game object`)

We should limit the calls to only return what they need. This will possibly require some frontend adaptation.

@Masclins
Copy link
Collaborator

Masclins commented Mar 1, 2018

I don't understand what POST, GET nor PUT means.

@kenan-rhoton
Copy link
Owner Author

@ruchnar
Copy link
Collaborator

ruchnar commented Mar 5, 2018

I guess "we" will need to change frontend acording to those REST calls.
EDIT: nevermind, just saw your last line, Kenan

@pernilsalat
Copy link
Collaborator

i'd like to have a try with this one

@kenan-rhoton
Copy link
Owner Author

done!

@Masclins
Copy link
Collaborator

@pernilsalat how's this going on?

@kenan-rhoton
Copy link
Owner Author

I'll release v0.1.1 without this if it's not done today, we need to focus on v0.2.0

@Masclins Masclins removed this from the Release v0.1.1 milestone Mar 26, 2018
@Masclins
Copy link
Collaborator

Maybe this has sense to be worked together with #78 (which is supposed to also be done by @pernilsalat, so everything's good)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants