File tree Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Expand file tree Collapse file tree 2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 7575 },
7676 "engines" : {
7777 "node" : " 10.x"
78+ },
79+ "volta" : {
80+ "node" : " 10.22.1"
7881 }
7982}
Original file line number Diff line number Diff line change @@ -645,7 +645,7 @@ async function getUserGroups (userId) {
645645 headers : { Authorization : `Bearer ${ token } ` } ,
646646 params : {
647647 page,
648- perPage : 1000 ,
648+ perPage : 5000 ,
649649 memberId : userId ,
650650 membershipType : 'user'
651651 }
@@ -669,16 +669,15 @@ async function getUserGroups (userId) {
669669 * @returns {Promise<Array> } the user groups
670670 */
671671async function getCompleteUserGroupTreeIds ( userId ) {
672- const childGroups = await getUserGroups ( userId )
673- const childGroupIds = _ . map ( childGroups , 'id' )
674- let result = [ ]
675- for ( const id of childGroupIds ) {
676- if ( ! result . includes ( id ) ) {
677- const expanded = await expandWithParentGroups ( id )
678- result = _ . concat ( result , expanded )
672+ const token = await getM2MToken ( )
673+ const result = await axios . get ( `${ config . GROUPS_API_URL } /memberGroups/${ userId } ` , {
674+ headers : { Authorization : `Bearer ${ token } ` } ,
675+ params : {
676+ uuid : true
679677 }
680- }
681- return _ . uniq ( result )
678+ } )
679+
680+ return result . data || [ ]
682681}
683682
684683/**
You can’t perform that action at this time.
0 commit comments