I am using Postman to call the management API and I can search for a role via name like…
https://.../api/v2/roles?name_filter=User%20Admin
But When I try to do something similar in the Management API Client…
getRoleByName(name){
return new Promise((res, rej)=>{
this.managementClient.getRoles({
name
}, async (err, roles)=>{
if (err) rej(err);
else {
res(roles);
}
})
})
}
I get all of the roles back instead of the singular role I would expect. I have confirmed that name is not undefined.
I can of course just get all roles and filter or use a node http request but I would like to use the client if I can.
How can I use the Node Management API Client to get a role by name.