페이지 로직

입력폼/버튼

로직

  1. 좋아요(heart) 클릭
    1. 해당 게시글이 어떤 게시글인지 고유한 값(id)으로 찾고,
    2. 이에 대한 heart click 수를 수정을 한 후
    3. PUT으로 보냅니다.

에러 상황

클릭이 되지 않는 경우

→ ?

존재하지 않는 게시글인 경우

→ 존재하지 않는 게시글입니다.

제한 사항

Response

// SUCCESS
{
    "post": {
        "id": "61c0252b8ec189519824a9b1",
        "content": "[email protected]",
        "createdAt": "2021-12-20T06:39:39.929Z",
        "updatedAt": "2021-12-20T08:05:12.727Z",
        "hearted": false,
        "heartCount": 0,
        "commentCount": 0,
        "author": {
            "_id": "작성자 id",
            "username": "2",
            "accountname": "2",
            "intro": "2",
            "image": "2",
            "isfollow": true, 
            "following": [],
            "follower": [
                "팔로워 한 사용자의 id"
            ],
            "followerCount": 1,
            "followingCount": 0
        }
    }
}

// FAIL
// 게시글이 존재하지 않을 때
존재하지 않는 게시글입니다.