RTyy / aiocomments

Comments Service Based on aiohttp
0 stars 0 forks source link

Make delete comment method #8

Open RTyy opened 7 years ago

RTyy commented 7 years ago

Any comment could be deleted only if it doesn't have any answers (children comments).

Request:

"id", comment_id,  # id of the comment that should be updated,
{
  "user_id": user_id,
}
curl -i -X DELETE -H "Content-Type: application/json" -d "{delete_comment_json_data}" http://local.server.com/api/comment/{id}/

Responses:

On Success Status Code: 200

{
}

On Error Status Code: 400, 403, 404

{
  "error": error_title,
  "data_errors": {
     "var_name": error_code,
     ...
  }
}
RTyy commented 7 years ago

1h