PublicDataWorks / verdad-frontend

MIT License
1 stars 0 forks source link

VER-181: [Backend] Add `like_count` and `dislike_count` to API responses for `get_snippets` and `get_snippet` #150

Open nhphong opened 1 week ago

nhphong commented 1 week ago

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:

  1. Update the get_snippets API endpoint to include like_count and dislike_count in the response for each snippet.
  2. Update the get_snippet API endpoint to include like_count and dislike_count in the response for the specific snippet.
  3. Ensure that the like_count accurately reflects the total number of likes each snippet has received.
  4. Ensure that the dislike_count accurately reflects the total number of dislikes each snippet has received.
  5. The API documentation is updated to reflect the changes in the response structure.
  6. Existing tests are updated to accommodate the new fields, and new tests are added to verify the correctness of like_count and dislike_count.
  7. Verify that the frontend displays the like_count and dislike_count correctly for each snippet using mock API responses.

Notes:

linear[bot] commented 1 week ago

VER-181 [Backend] Add `like_count` and `dislike_count` to API responses for `get_snippets` and `get_snippet`