Skip to content

Updating User #228

@manfioLP

Description

@manfioLP

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('leo@descope.com');
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.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions