Endpoint
Authentication
Required. User must be authenticated to unlike a post.Path Parameters
The unique identifier of the post to unlike (PostID)
Request Body
The username of the authenticated user removing the like
Behavior
- Uses a database transaction for atomic operation to ensure data consistency
- Removes the PostLike record for the user and post
- Decrements the post’s LikeCount
- Transaction is rolled back if any operation fails
Request
Response
204 No Content - Like removed successfully
Errors
Post or account does not exist, or action cannot be completed due to a block
The user has not liked the post