hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
181 stars 105 forks source link

[FIX] [BE] [ANCHOR: PYTHON] [Blog Dislike] Show Total Dislikes a Blog Has When New Blog Dislike Is Added #883

Open Tearsmith0 opened 3 months ago

Tearsmith0 commented 3 months ago

User Story:

I want to see the updated total number of dislikes immediately after I dislike a blog post,
so that I can instantly see the impact of my interaction and understand how others are reacting to the content.

Description:

Enhance the current blog dislike feature to return the updated total number of dislikes whenever a new BlogDislike is added. This will enable the frontend to display the current dislike count in real-time after a user interacts with the blog post, providing immediate feedback and improving user engagement.

Requirements:

  1. Modify the existing BlogDislike endpoint to include the updated total number of dislikes in the response after a new dislike is added.
  2. Ensure that the query retrieving the total dislikes is optimized, especially for blog posts with a high volume of interactions.
  3. The dislike count should be consistent and accurate across different users and sessions.
  4. Implement appropriate error handling to ensure that any issues during the dislike addition process do not disrupt the retrieval of the total dislike count.

Acceptance Criteria:

  1. After a user adds a dislike to a blog post, the API response should include the total number of dislikes for that post.
  2. The dislike count should be updated in real-time, allowing the frontend to reflect the latest data immediately.
  3. The system should efficiently retrieve the updated dislike count without negatively affecting response times, even for blogs with high interaction volumes.
  4. The total dislike count should accurately reflect the current number of dislikes at the moment of the latest interaction.
  5. The dislike count should be consistent across different sessions and users.
  6. The system should handle any errors during the dislike addition process gracefully and return appropriate error messages without disrupting the overall functionality.

Expected Outcome:

https://www.loom.com/share/4734ee3303684799bc3534b468013b2a

chimeziriobioha commented 3 months ago

I'm working on this issue.