Refactor nsf, team role + examples - #235
Conversation
| ), | ||
| }) | ||
| const path = add ? 'enterprise/role_team_add' : 'enterprise/role_team_remove' | ||
| const message = createInMessage(payload, path, Enterprise.RoleTeams) |
There was a problem hiding this comment.
we should add these to restMessages in keeperapi instead of inlining here
There was a problem hiding this comment.
understood, I moved it.
| ): Promise<void> { | ||
| if (links.length === 0) return | ||
| const payload = Enterprise.RoleTeams.create({ | ||
| roleTeam: links.map((link) => |
There was a problem hiding this comment.
roleTeam in both the add and remove API's has a 100 item limit:
https://keeper.atlassian.net/wiki/spaces/KA/pages/905543939/role_team_add
https://keeper.atlassian.net/wiki/spaces/KA/pages/905543972/role_team_remove
May want to chunk by 100 to avoid API errors, rather than leaving the caller to worry about this
There was a problem hiding this comment.
understood. Implemented this now.
|
|
||
| try { | ||
| await sendRoleTeamBatch(auth, toRemove, false) | ||
| await sendRoleTeamBatch(auth, toAdd, true) |
There was a problem hiding this comment.
probably better to split each of these into their own try-catch, since one could fail and one could succeed, and that would distort the returned statuses
There was a problem hiding this comment.
understood. I moved them into two separate functions with their own try catch
No description provided.