Skip to content

Commit b927e9e

Browse files
added check for api participant member role for npm build
1 parent 2ef9e98 commit b927e9e

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

src/api/services/kcUsersService.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,16 @@ export const removeApiParticipantMemberRole = async (
117117
id: SSP_KK_API_CLIENT_ID,
118118
roleName: API_PARTICIPANT_MEMBER_ROLE_NAME,
119119
});
120-
121-
await kcAdminClient.users.delClientRoleMappings({
122-
id: users[0].id!,
123-
clientUniqueId: SSP_KK_API_CLIENT_ID,
124-
roles: [
125-
{
126-
id: apiParticipantMemberRole.id!,
127-
name: apiParticipantMemberRole.name!,
128-
},
129-
],
130-
});
120+
if (apiParticipantMemberRole) {
121+
await kcAdminClient.users.delClientRoleMappings({
122+
id: users[0].id!,
123+
clientUniqueId: SSP_KK_API_CLIENT_ID,
124+
roles: [
125+
{
126+
id: apiParticipantMemberRole.id!,
127+
name: apiParticipantMemberRole.name!,
128+
},
129+
],
130+
});
131+
}
131132
};

0 commit comments

Comments
 (0)