Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 07ae64b

Browse files
Update query params passed to endpoint to get groups for user
1 parent e754e04 commit 07ae64b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/common/es-helper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -466,7 +466,7 @@ async function getFromElasticSearch (resource, ...args) {
466466

467467
if (params.enrich && resource === 'user') {
468468
const user = await enrichUser(result)
469-
const groups = await groupApi.getGroups('user', user.id)
469+
const groups = await groupApi.getGroups(user.id)
470470
user.groups = groups
471471
return user
472472
} else if (subDoc) {
@@ -1044,7 +1044,7 @@ async function searchElasticSearch (resource, ...args) {
10441044
result = await enrichUsers(users)
10451045
// enrich groups
10461046
for (const user of users) {
1047-
const groups = await groupApi.getGroups('user', user.id)
1047+
const groups = await groupApi.getGroups(user.id)
10481048
user.groups = groups
10491049
}
10501050
} else if (topSubDoc) {
@@ -1215,7 +1215,7 @@ async function searchUsers (authUser, filter, params) {
12151215
const result = await enrichUsers(users)
12161216
// enrich groups
12171217
for (const user of users) {
1218-
const groups = await groupApi.getGroups('user', user.id)
1218+
const groups = await groupApi.getGroups(user.id)
12191219
user.groups = groups
12201220
}
12211221

src/common/group-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ async function getM2Mtoken () {
1212
return m2m.getMachineToken(config.AUTH0_CLIENT_ID, config.AUTH0_CLIENT_SECRET)
1313
}
1414

15-
async function getGroups (membershipType, memberId) {
15+
async function getGroups (universalUID) {
1616
const m2mToken = await getM2Mtoken()
1717
const resp = await axios({
1818
method: 'get',
19-
params: { membershipType, memberId },
19+
params: { universalUID },
2020
url: config.GROUP_API_URL,
2121
headers: { Authorization: `Bearer ${m2mToken}` }
2222
})

0 commit comments

Comments
 (0)