Skip to content
This repository was archived by the owner on Jan 28, 2026. It is now read-only.

Commit fe6b5e3

Browse files
author
ge85riz
committed
🐛 fix: participant list export crashing issue when some participants don't have lastName
1 parent d5deb48 commit fe6b5e3

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

frontend/src/types/employee.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,10 @@ export interface ParticipationDetails {
4848
eventType: string;
4949
eventDate: string;
5050
eventAddress: string;
51-
name: string;
52-
lastName: string;
53-
gitlabUsername: string;
54-
email: string;
51+
name?: string;
52+
lastName?: string;
53+
gitlabUsername?: string;
54+
email?: string;
5555
dietTypes: (keyof typeof DietaryPreference)[];
5656
}
5757

frontend/src/utils/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ interface DietaryCombinationsResult {
1010
// Utility function to export participation data as CSV
1111
export const exportParticipationToCSV = (data: ParticipationDetails[], eventName: string) => {
1212
// Sort data alphabetically by last name
13-
const sortedData = data.sort((a, b) => a.lastName.localeCompare(b.lastName));
13+
const sortedData = data.sort((a, b) => (a.lastName || "").localeCompare(b.lastName || ""));
1414

1515
// Define CSV headers
1616
const headers = [

0 commit comments

Comments
 (0)