Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: corrections in blog like and dislike implementation #936

Conversation

chimeziriobioha
Copy link
Contributor

@chimeziriobioha chimeziriobioha commented Aug 23, 2024

Description

Fix 4 issues in the current blog likes and dislikes implementation.

  • Change the request method for blog dislike from PUT to POST
  • Add IP-Address to the implementation of blog dislike as it is with blog like
  • Return total likes count along with other data when a new like is created
  • Return total dislikes count along with other data when a new like is created

And, update documentations and tests to account for the new changes.

Related Issue

Issue 930
Issue 931
Issue 932
Issue 933

Motivation and Context

To improve the general user experience and have a working, and then quality code base that's well tested and easy to maintain.

How Has This Been Tested?

  • Unit Tests: Added tests to validate successful and failed requests as expected.
  • Test Environment: Mocked database; to avoid interference with the production environment.
  • Postman: Validation test has also been run on postman API tester, with screenshots attached below.

Screenshots:

Blog Like Request

post blog like success

Blog Dislike Request

post blog dislike success

Types of changes

  • Bug fix (non-breaking change which adds functionality)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@johnson-oragui johnson-oragui merged commit d5a6316 into hngprojects:dev Aug 23, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants