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
Develop an endpoint to allow users to update their comments on a blog post. The endpoint should validate that the comment exists, that the user owns the comment, and then update the content while preserving the original creation date. The response should return appropriate status codes based on different validation scenarios.
403 Forbidden: User is not authorized to update this comment.
404 Not Found: Blog post or comment does not exist.
500 Internal Server Error: Unexpected failure.
Acceptance Criteria
Validate that the blogId and commentId exist in the database.
Ensure only the comment owner can update their comment.
Update the content field while maintaining the CreatedAt timestamp.
Return the correct response and status codes.
Unit Tests
✅ Validate that the content is not empty or invalid.
✅ Ensure only the comment owner can update the comment.
✅ Check that nonexistent comments return a 404.
✅ Verify that the comment is correctly updated in the database.
✅ Ensure that the correct response status codes are returned.
The text was updated successfully, but these errors were encountered:
YastecHub
changed the title
[Feat] Implement Endpoint to Add User Region - C#
[Feat] Implement Endpoint to Add User Region
Feb 27, 2025
YastecHub
changed the title
[Feat] Implement Endpoint to Add User Region
[Feat] Implement Endpoint for Updating a Comment on a Blog
Feb 27, 2025
Description
Develop an endpoint to allow users to update their comments on a blog post. The endpoint should validate that the comment exists, that the user owns the comment, and then update the content while preserving the original creation date. The response should return appropriate status codes based on different validation scenarios.
Requirements
json
Responses
✅ Success (200 OK)
json
❌ Errors
Acceptance Criteria
Unit Tests
✅ Validate that the content is not empty or invalid.
✅ Ensure only the comment owner can update the comment.
✅ Check that nonexistent comments return a 404.
✅ Verify that the comment is correctly updated in the database.
✅ Ensure that the correct response status codes are returned.
The text was updated successfully, but these errors were encountered: