File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -158,18 +158,24 @@ export const updateConnectionEnabledClients = async (
158
158
) : Promise < boolean > => {
159
159
if ( ! connectionId || ! Array . isArray ( enabledClientIds ) || ! enabledClientIds . length ) return false ;
160
160
161
- const enabledClientUpdatePayload : Array < PatchClientsRequestInner > = enabledClientIds . map (
161
+ const enabledClientUpdatePayloads : Array < PatchClientsRequestInner > = enabledClientIds . map (
162
162
( clientId ) => ( {
163
163
client_id : clientId ,
164
164
status : true ,
165
165
} )
166
166
) ;
167
+ const payloadChunks = _ . chunk ( enabledClientUpdatePayloads , 50 ) ;
168
+
167
169
try {
168
- await auth0Client . connections . updateEnabledClients (
169
- {
170
- id : connectionId ,
171
- } ,
172
- enabledClientUpdatePayload
170
+ await Promise . all (
171
+ payloadChunks . map ( ( payload ) =>
172
+ auth0Client . connections . updateEnabledClients (
173
+ {
174
+ id : connectionId ,
175
+ } ,
176
+ payload
177
+ )
178
+ )
173
179
) ;
174
180
log . debug ( `Updated enabled clients for ${ typeName } : ${ connectionId } ` ) ;
175
181
return true ;
You can’t perform that action at this time.
0 commit comments