-
Notifications
You must be signed in to change notification settings - Fork 1
신고하기
boong_u edited this page Sep 28, 2021
·
18 revisions
신고하기
POST : /api/reports
Content-Type: application/json
x-auth-token : 로그인 시 받는 jwt token (Ex:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyIjp7ImlkIjoiNjExMGNjMmFjNTBjZmY2YzdjOGIxZTZlIn0sImlhdCI6MTYyODU2NjQxMiwiZXhwIjoxNjI4NjAyNDEyfQ.SWMPObKmGjQcQOUgvHF1HNupO2OovuOHsCXz7O0HZck)
params | Example | Description | Default |
---|---|---|---|
None | None | None | None |
Key | Example | Description | Default |
---|---|---|---|
targetReview : String(Required) | 6110cd4b58d715bfe443ed72 |
신고할 리뷰 게시글의 ID(mongoose ObjectId type) | None |
Key | Example | Description | Default |
---|---|---|---|
targetDog : String(Required) | 6110cd4b58d715bfe443ed3e |
신고할 강아지 게시글의 ID(mongoose ObjectId type) | None |
Example URL : {{baseURL}}/api/reports
Sucess : 200
{
"_id": "611f03995b61cc3db4602d21",
"reportUser": "611cf3e5da587b36104d464e",
"targetUser": "6110cc2ac50cff6c7c8b1e6e",
"targetReview": "6110cd4b58d715bfe443ed72",
"reportDate": "2021-08-20T01:21:29.805Z",
"__v": 0
}
Sucess : 200
{
"_id": "611f1089c19387529ce41690",
"reportUser": "611cf3e5da587b36104d464e",
"targetUser": "6110cc2ac50cff6c7c8b1e6e",
"targetDog": "6110cd4b58d715bfe443ed72",
"reportDate": "2021-08-20T02:16:41.109Z",
"__v": 0
}
토큰이 없거나 잘못된 경우 : 401
{
"error": "No token"
}
targetUser나 user가 없는 경우 : 400
{
"error": "There is no user or targetUser in the request body."
}
targetDog나 targetReview가 없는 경우 : 400
{
"error": "There is no TargetDog or targetReview in the request body."
}
Dog id가 잘못된 경우 : 400
{
"error": "Dog id is not valid."
}
Review id가 잘못된 경우 : 400
{
"error": "Review id is not valid"
}
신고가 중복된 경우 : 400
{
"error": "It's a duplicate report."
}
dog를 찾을 수 없는 경우 : 404
{
"error": "Dog Not Found"
}
review를 찾을 수 없는 경우 : 404
{
"error": "Review Not Found"
}
Server Error : 500
{
"error" : "Internal Server Error"
}