특정 게시글 좋아요 토글

API
post
METHOD
PUT
PATH
api/posts/{postId}/like
개발완료
담당자

Description

<특정 게시글 좋아요 토글>
특정 게시글 좋아요 토글 기능
해당 게시글에 사용자가 좋아요 누른 히스토리를 가져와 이전에 눌렀는지 확인
누르지 않은 게시글이라면, 클릭 시 좋아요 수가 증가, 다시 클릭 시 좋아요 수 원래대로 감소

Response

Content-type: application/json
Shell
복사
{ "isLiked": true // 이전에 좋아요 눌린 상태이므로 다시 요청하면 좋아요 취소 } { "isLiked": false // 좋아요를 새로 추가하는 요청 } { "id": 1, "memberId": 1, "memberName": "John", "drink": { "id": 1, "placeName": "서울특별시", "name": "맛있는 특산주", "type": "BEER", "degree": 7.0, "sweetness": 5, "cost": 5000, "averageRating": 4.65, "description": "초콜릿으로 만든 맥주", "imageUrl": null, "createdAt": "2024-09-23T23:36:35" }, "type": "REVIEW", "content": "이 막걸리는 독특한 맛을 가지고 있어요!", "rating": 4.5, "tags": [ { "tagId": 1, "tagName": "고소" }, { "tagId": 2, "tagName": "풍미" } ], "imageUrl": "http://example.com/image.png", "viewCount": 5, "likeCount": 1, "createdAt": "2024-09-26T02:20:41.851615", "updatedAt": "2024-09-26T02:27:13.059691", "isLiked": true }
JSON
복사

Error

HTTP/1.1 4XX
”에러 메시지”