You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: