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

list users by multiple roles #340

Closed
goldylucks opened this issue Apr 1, 2022 · 2 comments
Closed

list users by multiple roles #340

goldylucks opened this issue Apr 1, 2022 · 2 comments

Comments

@goldylucks
Copy link

Not sure this is supported, I'm trying to do this:

zdApi.users.listWithFilter("role", ["admin", "agent"])

and getting empty response.

this however works:

zdApi.users.listWithFilter("role", "admin")

happy to submit a PR with a bit of guidance, I started developing my own zd client module and then saw this library :)

btw, that method isn't on the docs nor on the types library, happy to add it there as well!

@goldylucks
Copy link
Author

After poking around the code a bit, I tried to hack it like this:

  zdApi.requestAll(
    "GET",
    "users/list?role[]?=admin&role[]=agent",
  )

but it isn't exposed on the client

@goldylucks
Copy link
Author

A nice API could be:

zdApi.users.list({options}, cb)

// i.e.
zdApi.users.list({role: ["agent", "admin"]}, cb)

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