Skip to content

다이어리 수정

YeongWoooo edited this page Jan 6, 2021 · 3 revisions

다이어리 수정

메소드 경로 설명
PUT /diaries/:id 다이어리 수정


요청 헤더

Content-Type: application/json

요청 바디

{
    "position": 4,
    "depth": 3,
    "contents": "test_contents_0",
    "userId": 8,
    "sentenceId": 40,
    "emotionId": 7,
    "wroteAt": "2020-08-16T00:00:00.000Z",

응답 바디

SUCCESS : 일기 수정 성공

{
    "message": "일기 수정 성공",
    "data": {
        "id": 1,
        "position": 4,
        "depth": 3,
        "contents": "test_contents_0",
        "userId": 8,
        "sentenceId": 40,
        "emotionId": 7,
        "wroteAt": "2020-08-16T00:00:00.000Z",
        "createdAt": "2021-01-06T07:50:51.000Z",
        "updatedAt": "2021-01-06T07:50:51.000Z",
        "UserId": 8,
        "SentenceId": 40,
        "EmotionId": 7,
        "Sentence": {
            "id": 40,
            "contents": "test_contents_39",
            "bookName": "test_bookName_39",
            "writer": "test_writer_39",
            "publisher": "test_publisher_39",
            "emotionId": 5,
            "createdAt": "2021-01-06T07:50:51.000Z",
            "updatedAt": "2021-01-06T07:50:51.000Z",
            "EmotionId": 5
        },
        "Emotion": {
            "id": 7,
            "name": "추억",
            "createdAt": "2021-01-06T07:50:51.000Z",
            "updatedAt": "2021-01-06T07:50:51.000Z"
        }
    }
}

FAIL : 빈값이 있을 경우 (400)

{
    "message": "필요한 값이 없습니다."
}

FAIL : 서버 내부 에러 (500)

{
    "message": "일기 전체 조회 실패"
}

Clone this wiki locally