File tree 5 files changed +31
-1
lines changed
5 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ Object {
53
53
" dropGroups" : [Function ],
54
54
" getGroupsDone" : [Function ],
55
55
" getGroupsInit" : [Function ],
56
+ " getMemberGroups" : [Function ],
56
57
},
57
58
" looker" : Object {
58
59
" getLookerDone" : [Function ],
Original file line number Diff line number Diff line change 31
31
"lint:js" : " ./node_modules/.bin/eslint --ext .js,.jsx ." ,
32
32
"test" : " npm run lint && npm run jest"
33
33
},
34
- "version" : " 1.1.8 " ,
34
+ "version" : " 1000.27.14 " ,
35
35
"dependencies" : {
36
36
"auth0-js" : " ^6.8.4" ,
37
37
"config" : " ^3.2.0" ,
Original file line number Diff line number Diff line change @@ -42,10 +42,21 @@ function getGroupsDone(groupIds, tokenV3) {
42
42
return getService ( tokenV3 ) . getGroupMap ( groupIds ) ;
43
43
}
44
44
45
+ /**
46
+ * Get groups that a member belong to
47
+ * @param {* } userId the member's userId
48
+ * @param {* } tokenV3 the member's token
49
+ * @returns
50
+ */
51
+ function getMemberGroups ( userId , tokenV3 ) {
52
+ return getService ( tokenV3 ) . getMemberGroups ( userId ) ;
53
+ }
54
+
45
55
export default createActions ( {
46
56
GROUPS : {
47
57
DROP_GROUPS : dropGroups ,
48
58
GET_GROUPS_INIT : getGroupsInit ,
49
59
GET_GROUPS_DONE : getGroupsDone ,
60
+ GET_MEMBER_GROUPS : getMemberGroups ,
50
61
} ,
51
62
} ) ;
Original file line number Diff line number Diff line change @@ -84,6 +84,11 @@ function onGetGroupsDone(state, action) {
84
84
return { ...state , groups, loading } ;
85
85
}
86
86
87
+
88
+ function onGetMemberGroups ( state , action ) {
89
+ return { ...state , memberGroups : action . payload } ;
90
+ }
91
+
87
92
/**
88
93
* Creates a new Groups reducer with the specified initial state.
89
94
* @param {Object } initialState Optional. Initial state.
@@ -95,9 +100,11 @@ function create(initialState) {
95
100
[ a . dropGroups ] : onDropGroups ,
96
101
[ a . getGroupsInit ] : onGetGroupsInit ,
97
102
[ a . getGroupsDone ] : onGetGroupsDone ,
103
+ [ a . getMemberGroups ] : onGetMemberGroups ,
98
104
} , _ . defaults ( initialState ? _ . clone ( initialState ) : { } , {
99
105
groups : { } ,
100
106
loading : { } ,
107
+ memberGroups : [ ] ,
101
108
} ) ) ;
102
109
}
103
110
Original file line number Diff line number Diff line change @@ -354,6 +354,17 @@ class GroupService {
354
354
getTokenV3 ( ) {
355
355
return this . private . tokenV3 ;
356
356
}
357
+
358
+ /**
359
+ * Gets the corresponding user's groups information
360
+ * @param {* } userId the userId
361
+ * @returns
362
+ */
363
+ async getMemberGroups ( userId ) {
364
+ const url = `/groups/memberGroups/${ userId } ` ;
365
+ const res = await this . private . api . get ( url ) ;
366
+ return handleApiResponse ( res ) ;
367
+ }
357
368
}
358
369
359
370
let lastInstance = null ;
You can’t perform that action at this time.
0 commit comments