Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update findSpectatableGames to include player details in the response. #7

Closed
Hakaabi opened this issue Dec 10, 2024 · 0 comments · May be fixed by #17
Closed

Update findSpectatableGames to include player details in the response. #7

Hakaabi opened this issue Dec 10, 2024 · 0 comments · May be fixed by #17

Comments

@Hakaabi
Copy link

Hakaabi commented Dec 10, 2024

Update the findSpectatableGames helper function to include player details in the game response. Ensure that the response structure matches the requirements for the game list display.

Tasks:

-Add the .populate('players') call to the query in findSpectatableGames.
-Modify the function to transform the player data to include only id and username.
-Test the updated function to ensure it works as expected.

Acceptance Criteria:
-The findSpectatableGames helper function must include a .populate('players') call in its query to retrieve player data for each game.
-The function must return a players array where each player's data is transformed to include only id and username, ensuring no extraneous data is exposed.
-Backend tests must verify the correctness of the updated response structure, including edge cases (no players, one player, two players), and confirm the function operates as expected.

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

Successfully merging a pull request may close this issue.

2 participants