사용자 차단 목록 관리

1. 차단된 사용자 조회

const resp = await client.getBlockedUsers({}); // paginated

if resp.hasNext {
    // 다음 페이지 요청을 위해 필요
    const lastUserId = resp.users[resp.users.length - 1].id;
   
    // 다음 페이지 요청 
    const moreResp = await client.getBlockedUsers({lastUserId: lastUserId});
}

Response

{
  "users": [
    {
      "id": "user456",
      "username": "user456"
      "profileImageUrl": "http://cnd.test.com/123.jpg",
      "updatedAt": 1603245523729,
      "createdAt": 1603244410844
    }
  ],
  "hasNext": false // use for pagination
}

2. 사용자 차단 / 차단 해제

사용자를 Block / Unblock할 수 있습니다.

// 차단
await client.blockUser({userId: 'bad_user'});

// 차단 해제
await client.unblockUser({userId: 'another_user'});

다음과 같은 방식으로 동작합니다.

Last updated