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

Updating User #228

Open
manfioLP opened this issue Jul 10, 2023 · 1 comment
Open

Updating User #228

manfioLP opened this issue Jul 10, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@manfioLP
Copy link

When updating a user I found out by trying to update user.customAttributes with more than one attribute, we need to either:

  1. Make n+ sdk calls:
await Promise.all([
   descopeClient.management.user.updateCustomAttribute(loginId, 'param1', 'PRO'),
   descopeClient.management.user.updateCustomAttribute(loginId, 'param2', 1689018774081),
   descopeClient.management.user.updateCustomAttribute(loginId, 'param3', 'xxxxx'),
])

or
2. Load user attributes and then call update()

const user = await descopeClient.management.user.load('[email protected]');
const updt = await descopeClient.management.user.update(user.loginIds[0], user.email, user.phone, user.displayName, user.roleNames, user.tenants, {param1: 'PRO', param2: 1689018774081, param3: 'xxxxxx'})

but the same applies for any parameter that you wish to update but is in a different order.

Suggestion: change parameters to an object so we send just the ones we need
OR
add a skip value (e.g. if email==='_' doNotUpdateThis).

also the updateCustomAttribute() could be accept more than one attribute per call.

@manfioLP
Copy link
Author

quick hotfix suggestion: #229

I know it needed further analysis etc... specially because sdk-core-js isn't public but the purpose was just to make more clear what I meant on the issue 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants