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 like owner:{ "status_code": 401, "message": "Insufficient permission" }
Invalid blog ID:{ "status_code": 404, "message": "BlogLike does not exist." }***
Testing:
Write end-to-end backend unit tests for the delete blog like process.
Test all possible outcomes and reactions for like (e.g., successful, failed, etc).
Added Fix:
Enable /api/v1/blogs/{blog_id}/like endpoint to automatically remove existing dislike by the current_user before creating new like, and vice versa with the /api/v1/blogs/{blog_id}/dislike endpoint.
This is important if a user clicks the like button after already clicking the dislike button without first removing the dislike. 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:
Description:
Implement an endpoint to enable users who previously
liked
a blog post to remove thelike
.Acceptance Criteria:
PROTECTED
endpoint, requiring authentication.DELETE
request at/api/v1/blogs/likes/{blog_like_id}
.Purpose
To enable a blog post readers to remove like from any particular post after adding one.
Requirements
Expected Outcome:
Blog readers should be able to remove like from a blog post if they posted it in error or just changed their mind.
Tasks:
DELETE: /api/v1/blogs/likes/{blog_like_id}
) to handle request.blog_like_id
, accessBlogLike
object and confirm that requester created it.BlogLike
object from the databaseExample Request [With Auth Token]:
Response Body [Success]:
Response Body [Errors]:
{ "status_code": 401, "message": "Could not validate credentials." }
{ "status_code": 401, "message": "Insufficient permission" }
{ "status_code": 404, "message": "BlogLike does not exist." }
***Testing:
Added Fix:
Enable
/api/v1/blogs/{blog_id}/like
endpoint to automatically remove existingdislike
by thecurrent_user
before creating newlike
, and vice versa with the/api/v1/blogs/{blog_id}/dislike
endpoint.This is important if a user clicks the like button after already clicking the dislike button without first removing the dislike. 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: