⌨️댓글 CRUD API
댓글 작성 API
POST localhost:3000/api/posts/:postId/comments
Request Body
Name
Type
Description
content*
string
content of the comment
{
message:"댓글 작성에 성공하였습니다."
}{
errorMessage:"댓글 작성에 실패하였습니다."
}{
errorMessage:"댓글 내용을 입력해주세요."
}댓글 전체 조회 API
GET localhost:3000/api/posts/:postId/comments
{
comments
}{
message:"댓글이 없습니다. 첫 작성자가 되어 주세요."
}{
errorMessage:"댓글 조회에 실패하였습니다."
}댓글 수정 API
PATCH localhost:3000/api/posts/:postId/comments/:commentId
Request Body
Name
Type
Description
content*
String
content of the comment
{
message:"댓글 수정에 성공하였습니다."
}{
errorMessage:"댓글 내용을 입력해주세요."
}{
errorMessage:"댓글 수정에 실패하였습니다."
}댓글 삭제 API
DELETE localhost:3000/api/posts/:postId/comments/:commentId
{
message:"댓글 삭제에 성공하였습니다."
}{
errorMessage:"댓글 삭제에 실패하였습니다."
}Last updated