Group Owner Update

입력한 primary key에 해당하는 MyGroup object의 owner를 변경합니다.
변경할 그룹장의 pk를 데이터에 넣은 뒤 PATCH 요청을 보냅니다.

URL
/group/<pk>/change-owner/

Method
PATCH

Header

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

Input data

Key Description Value Type Require
new_owner_pk 변경할 그룹장의 pk member pk Integer True

Success response

HTTP Status code
200

Content

{
    "pk": 1,
    "name": "Test Group",
    "owner": {
        "pk": 2,
        "email": "[email protected]",
        "nickname": "a1",
        "username": "",
        "profile_img": "http://localhost:8000/static/images/no_profile.png",
        "is_follow": true
    },
    "profile_img": "http://localhost:8000/static/images/no_image.png",
    "group_type": "PUBLIC",
    "description": "description input test",
    "tags": [
        {
            "pk": 1,
            "name": "test1"
        },
        {
            "pk": 2,
            "name": "test2"
        },
        {
            "pk": 3,
            "name": "test3"
        }
    ]
}

Error response

New owner pk error

HTTP Status code
400

Content

# 해당 pk 값을 가진 유저가 없는 경우
{
    "new_owner_pk": [
        "잘못된 유저 pk 값입니다."
    ]
}
# 해당 pk 값을 가진 유저가 그룹의 멤버가 아닌 경
{
    "new_owner_pk": [
        "해당 유저는 그룹의 멤버가 아닙니다."
    ]
}

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 ""