Skip to content

Commit

Permalink
[Backend] Fix study guidance group fetching when the user has no sisP…
Browse files Browse the repository at this point in the history
…ersonId
  • Loading branch information
valtterikantanen committed Nov 28, 2024
1 parent afcf72e commit c7b8685
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion services/backend/src/services/studyGuidanceGroups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ type StudyGuidanceGroup = {
}

const getGroupsFromImporter = async (sisPersonId: string) => {
if (!importerClient) {
if (!importerClient || !sisPersonId) {
return []
}
const answerTimeout = new Promise(resolve => setTimeout(resolve, 2000))
Expand Down
3 changes: 2 additions & 1 deletion services/backend/src/util/jami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@ export const getUserIamAccess = async (
return {}
}
try {
const getSisuAccess = !isStaging && sisPersonId != null && sisPersonId !== ''
const { data: iamAccess } = await jamiClient.post('/', {
userId: sisPersonId,
iamGroups,
getSisuAccess: !isStaging,
getSisuAccess,
})
const { specialGroup } = iamAccess as { specialGroup: Record<string, boolean> }
delete iamAccess.specialGroup
Expand Down

0 comments on commit c7b8685

Please sign in to comment.