You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Unrecognized user:{ "status_code": 401, "message": "Could not validate credentials." }
Not the blog dislike owner:{ "status_code": 401, "message": "Insufficient permission" }
Invalid blog ID:{ "status_code": 404, "message": "BlogDislike does not exist." }***
Testing:
Write end-to-end backend unit tests for the delete blog dislike process.
Test all possible outcomes and reactions for like (e.g., successful, failed, etc).
Added Fix:
Enable /api/v1/blogs/{blog_id}/dislike endpoint to automatically remove existing like by the current_user before creating new dislike, and vice versa with the /api/v1/blogs/{blog_id}/like endpoint.
This is important if a user clicks the dislike button after already clicking the like button without first removing the like. Otherwise, the database will have unintended records of both like and dislike for the same user on the same blog.
The text was updated successfully, but these errors were encountered:
chimeziriobioha
changed the title
[FEAT]: Endpoint To Delete BlogDislike
[FEAT]: Endpoint To Delete Blog Dislike
Aug 24, 2024
Description:
Implement an endpoint to enable users who previously
disliked
a blog post to remove thedislike
.Acceptance Criteria:
PROTECTED
endpoint, requiring authentication.DELETE
request at/api/v1/blogs/dislikes/{blog_dislike_id}
.Purpose
To enable a blog post readers to remove dislike from any particular post after adding one.
Requirements
Expected Outcome:
Blog readers should be able to remove dislike from a blog post if they posted it in error or just changed their mind.
Tasks:
DELETE: /api/v1/blogs/dislikes/{blog_dislike_id}
) to handle request.blog_dislike_id
, accessBlogDislike
object and confirm that requester created it.BlogDislike
object from the databaseExample Request [With Auth Token]:
Response [Success]:
Response Body [Errors]:
{ "status_code": 401, "message": "Could not validate credentials." }
{ "status_code": 401, "message": "Insufficient permission" }
{ "status_code": 404, "message": "BlogDislike does not exist." }
***Testing:
Added Fix:
Enable
/api/v1/blogs/{blog_id}/dislike
endpoint to automatically remove existinglike
by thecurrent_user
before creating newdislike
, and vice versa with the/api/v1/blogs/{blog_id}/like
endpoint.This is important if a user clicks the dislike button after already clicking the like button without first removing the like. Otherwise, the database will have unintended records of both like and dislike for the same user on the same blog.
The text was updated successfully, but these errors were encountered: