Post Update
입력한 primary key에 해당하는 Post object의 정보를 update합니다.
변경하고자 하는 데이터를 1개 이상 입력한 후 PATCH 요청을 보냅니다.
URL
/post/<pk>/
Method
PUT
PATCH
URL Params
Key | Description | Value | Type | Require |
---|---|---|---|---|
content | 포스트 내용 | post content | String | False |
image | 첨부할 사진 | Image | Image File | False |
video | 첨부할 영상 주소(Youtube) | Youtube video url | String | False |
Success Response
HTTP Status Code
200
content
{
"pk": 1,
"author": 1,
"group": 1,
"content": "Post Update",
"image": null,
"video": null,
"like_count": 1,
"comment_count": 8,
"is_like": true
}
Error response
Unauthorized error
HTTP Status code
401
Content
{
"detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}
Request user is not author error
HTTP Status code403
Content
{
"detail": "작성자만 요청할 수 있는 작업입니다."
}
Post object does not exist error
HTTP Status code
404
Content
{
"detail": "찾을 수 없습니다."
}