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_snippetsandget_snippetAPI endpoints to includelike_countanddislike_countfor each snippet, so that the frontend can display the number of likes and dislikes for each snippet to the users.Acceptance Criteria:
get_snippetsAPI endpoint to includelike_countanddislike_countin the response for each snippet.get_snippetAPI endpoint to includelike_countanddislike_countin the response for the specific snippet.like_countaccurately reflects the total number of likes each snippet has received.dislike_countaccurately reflects the total number of dislikes each snippet has received.like_countanddislike_count.like_countanddislike_countcorrectly for each snippet using mock API responses.Notes: