Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improving Documentation: Addressing the Issue with Implementing RBAC #910

Open
Ehren12 opened this issue Apr 16, 2024 · 2 comments
Open

Comments

@Ehren12
Copy link
Contributor

Ehren12 commented Apr 16, 2024

While exploring the documentation for Implementing basic Role Based Access Control (RBAC) with metadata, I encountered an issue that needs attention:

It is worth knowing that I am using Clerk Core 2.0..

Screenshot 2024-04-16 130802

The issue arises from the fact that await clerkClient.users.getUserList({ query }) does not directly return an array as expected.

Proposed Solution

To address this issue, we can simply access the data field returned by clerkClient.users.getUserList({ query }). By doing so, we ensure that we retrieve the array of users correctly.

Here's how to implement the correction:
const users = query ? (await clerkClient.users.getUserList({ query })).data : [];

By making this adjustment, we ensure that the code accurately captures the array of users, resolving the issue encountered.

I would appreciate any feedback on this proposed solution and would be glad to make further adjustments as needed.

@alexisintech
Copy link
Member

would you like to make a PR to incite this change?
simply clone the docs repo, open the page, make the change, and then submit the PR :~) be sure to include "Resolves Issue 910" in the title of the PR

@Ehren12
Copy link
Contributor Author

Ehren12 commented May 11, 2024

Yes i will love to sorry im replying this late.

Ehren12 added a commit to Ehren12/clerk-docs that referenced this issue May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants