Skip to content

Commit bb3fa77

Browse files
simplifying changes
1 parent 400bf4f commit bb3fa77

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

src/api/routers/managementRouter.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,12 @@ const handleGetUserParticipants = async (req: ParticipantRequest, res: Response)
2323
const { userId } = z.object({ userId: z.coerce.number() }).parse(req.params);
2424
const participants = await getUserParticipants(userId);
2525
const list = participants ?? [];
26-
2726
let elevatedRole = null;
2827
if (list.length === 0) {
2928
const user = await getUserById(userId);
3029
if (user?.email) {
31-
try {
32-
const kcAdminClient = await getKcAdminClient();
33-
elevatedRole = await getElevatedRoleByEmail(kcAdminClient, user.email);
34-
} catch {
35-
// Keycloak unavailable or user not found; keep elevatedRole null
36-
}
30+
const kcAdminClient = await getKcAdminClient();
31+
elevatedRole = await getElevatedRoleByEmail(kcAdminClient, user.email);
3732
}
3833
}
3934

src/web/services/participant.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ export async function GetAllParticipants() {
4444
}
4545
}
4646

47-
export type GetUserParticipantsResponse = {
47+
type GetUserParticipantsResponse = {
4848
participants: ParticipantDTO[];
4949
elevatedRole: string | null;
5050
};

0 commit comments

Comments
 (0)