Skip to content

Commit a4720a5

Browse files
committed
Fill in missing group pictures in user detail view
1 parent 2503775 commit a4720a5

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/common/backend.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,14 @@ class UserService {
395395

396396
public async getUser(userId: string): Promise<UserDtoWithDetails> {
397397
return axiosAuth.get<UserDtoWithDetails>(`/users/${userId}`)
398-
.then(response => AuthorityService.fillInMissingPicture(response.data))
398+
.then(response => {
399+
const user = response.data;
400+
const filledUser = AuthorityService.fillInMissingPicture(user);
401+
return {
402+
...filledUser,
403+
groups: user.groups.map(g => AuthorityService.fillInMissingPicture({ ...g, type: 'GROUP' as const }))
404+
};
405+
})
399406
.catch((error) => rethrowAndConvertIfExpected(error, 404));
400407
}
401408

0 commit comments

Comments
 (0)