Group Update

입력한 primary key에 해당하는 MyGroup object의 정보를 update합니다.
변경하고자 하는 데이터를 입력한 후 PATCH 요청을 보냅니다.

URL
/group/<pk>/

Method
PATCH

Header

Key Description Value Type Require
Authorization 요청을 보내는 유저의 token user token String True

Input data

Key Description Value Type Require
name 그룹 이름 - String False
group_type 그룹 타입 PUBLIC, PRIVATE, HIDDEN String False
profile_img 그룹 프로필 사진 - Image File False
description 그룹 설명 - String False
tag_names 그룹 태그 - List(String) False

Success response

HTTP Status code
200

Content

[
{
    "pk": 2,
    "owner": {
        "pk": 1,
        "email": "[email protected]",
        "nickname": "admin",
        "username": "",
        "profile_img": "http://localhost:8000/media/images/no_profile.png",
        "is_follow": false
    },
    "name": "Test Group2",
    "profile_img": "http://localhost:8000/static/images/no_image.png",
    "group_type": "PUBLIC",
    "description": "description input test",
    "tags": [
        {
            "pk": 9,
            "name": "test4"
        },
        {
            "pk": 10,
            "name": "test5"
        },
        {
            "pk": 11,
            "name": "test6"
        }
    ]
}]

Error response

Group name validation error

HTTP Status code
400

Content

{
    "name": [
        "my group의 name은/는 이미 존재합니다."
    ]
}

이미 존재하는 name으로 요청한 경우

{
    "name": [
        "이 항목을 채워주십시오."
    ]
}

name을 넣지않고 요청한 경우

Unauthorized error

HTTP Status code
401

Content

{
    "detail": "자격 인증데이터(authentication credentials)가 제공되지 않았습니다."
}

Request user is not group owner error

HTTP Status code
403

Content

{
    "detail": "그룹장 외에는 요청할 수 없습니다."
}

results matching ""

    No results matching ""