File tree 2 files changed +12
-10
lines changed
2 files changed +12
-10
lines changed Original file line number Diff line number Diff line change 75
75
},
76
76
"engines" : {
77
77
"node" : " 10.x"
78
+ },
79
+ "volta" : {
80
+ "node" : " 10.22.1"
78
81
}
79
82
}
Original file line number Diff line number Diff line change @@ -645,7 +645,7 @@ async function getUserGroups (userId) {
645
645
headers : { Authorization : `Bearer ${ token } ` } ,
646
646
params : {
647
647
page,
648
- perPage : 1000 ,
648
+ perPage : 5000 ,
649
649
memberId : userId ,
650
650
membershipType : 'user'
651
651
}
@@ -669,16 +669,15 @@ async function getUserGroups (userId) {
669
669
* @returns {Promise<Array> } the user groups
670
670
*/
671
671
async 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
679
677
}
680
- }
681
- return _ . uniq ( result )
678
+ } )
679
+
680
+ return result . data || [ ]
682
681
}
683
682
684
683
/**
You can’t perform that action at this time.
0 commit comments