-
Notifications
You must be signed in to change notification settings - Fork 0
Comment Controller
Harman Lamba edited this page May 22, 2020
·
2 revisions
Method Type: GET
Description: Gets a list of comments in chronological order (without duplicates) for the given postId, starting at the newest comment
Input Parameter | Type | Description |
---|---|---|
postId | int | The id of the post for which all the comments are requsted |
Status Code | Status Code Meaning | Response |
---|---|---|
200 Ok
|
The list of Comments was successfully retrieved | List of CommentDto |
404 Not Found
|
A post with the supplied postId does not exist | - |
- In the case that a post does not have any comments, a list of size 0 is returned.
Method Type: POST
Description: Create a comment for a given post given the CommentDTO. The parameters of for the CommentDTO for a successful request are mentioned.
Input Parameter | Type | Description |
---|---|---|
postId | int | The id of the post for which the comment is being created |
parentCommentId | int? | The id of of the parent comment in the case of the comment being a reply. In the case that the comment is a parent comment, null is passed |
body | string | The body/content of the comment |
CommentTypeId | int | Comment type id, (1 in the case of a general comment, 2 in the case of a question) |
Status Code | Status Code Meaning | Response |
---|---|---|
201 Created
|
The comment was created successfull | Location Header sets the URI of the created comment. Body of the response returns an updated CommentDto |
409 Conflict
|
A post with the supplied postId does not exist | - |
Jainal Gandhi | Harman Lamba | Eric Leung | Salma Sanad
Made with love 👨👨👧👦💖