forked from boolean-uk/java-team-dev-server-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem Description
As a user that is logged in, I want to add comments to posts and view existing comments,
so that I can discuss with other users posts.
Required Changes
- Implement POST endpoint to create comment /posts/{id}/comments
- Validate that the comment content is not empty.
- Store the comment in the database with: user_id (author), post_id, content
- Implement GET endpoint to retrieve all comments for a post /posts/{id}/comments
- Return all comments linked to the post.
- Each comment should include: Author’s first name and last name (from profile), Comment content
Acceptance Criteria
Succes response:
201 with the newly created comment object. (POST)
200 with an array of all comments for the post. (GET)
Error response:
- 400 if comment content is empty.
- 404 if post does not exist.
Dependencies
- Database table comments must exist (Database migration issue).
- Verify the logged-in user.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Todo