As a developer, I want the get_snippets and get_snippet API endpoints to include like_count and dislike_count for each snippet, so that the frontend can display the number of likes and dislikes for each snippet to the users.
Acceptance Criteria:
Update the get_snippets API endpoint to include like_count and dislike_count in the response for each snippet.
Update the get_snippet API endpoint to include like_count and dislike_count in the response for the specific snippet.
Ensure that the like_count accurately reflects the total number of likes each snippet has received.
Ensure that the dislike_count accurately reflects the total number of dislikes each snippet has received.
The API documentation is updated to reflect the changes in the response structure.
Existing tests are updated to accommodate the new fields, and new tests are added to verify the correctness of like_count and dislike_count.
Verify that the frontend displays the like_count and dislike_count correctly for each snippet using mock API responses.
Notes:
Consider potential performance impacts of adding these counts and optimize queries if necessary.
Coordinate with the frontend team to ensure they are aware of the changes and update any relevant UI components.
As a developer, I want the
get_snippets
andget_snippet
API endpoints to includelike_count
anddislike_count
for each snippet, so that the frontend can display the number of likes and dislikes for each snippet to the users.Acceptance Criteria:
get_snippets
API endpoint to includelike_count
anddislike_count
in the response for each snippet.get_snippet
API endpoint to includelike_count
anddislike_count
in the response for the specific snippet.like_count
accurately reflects the total number of likes each snippet has received.dislike_count
accurately reflects the total number of dislikes each snippet has received.like_count
anddislike_count
.like_count
anddislike_count
correctly for each snippet using mock API responses.Notes: