The user should also have a role because when I ou...
# support-questions
k
The user should also have a role because when I output all users with the "pending" role, the userId comes up
Copy code
javascript
async function getUsersThatHaveRole(role: string) {
  const response = await UserRoles.getUsersThatHaveRole(role);

  console.log(response);

  if (response.status === "UNKNOWN_ROLE_ERROR") {
    // No such role exists
    return;
  }

  const users: string[] = response.users;
}
Copy code
javascript
{
  users: [
    '8cba27de-db0c-43ea-9d76-0ac6a44d7a38',
    '1aac8fa3-5a95-4016-902f-1613d8e339cb'
  ],
  status: 'OK'
}