From 0dfd6a6f900c4774f347db20fbf2a9e6922607c8 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Thu, 1 May 2025 17:47:42 -0400 Subject: [PATCH] Fix guest names display in EventView to handle both string and array formats --- frontend/src/components/EventView.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/frontend/src/components/EventView.tsx b/frontend/src/components/EventView.tsx index 44f2837..7559a81 100644 --- a/frontend/src/components/EventView.tsx +++ b/frontend/src/components/EventView.tsx @@ -22,7 +22,7 @@ interface RSVP { attending: string; bringing_guests: string; guest_count: number; - guest_names: string; + guest_names: string[] | string; items_bringing: string[] | string; } @@ -273,7 +273,11 @@ const EventView: React.FC = () => { {rsvp.attending.charAt(0).toUpperCase() + rsvp.attending.slice(1)} {rsvp.bringing_guests === 'yes' ? - `${rsvp.guest_count} (${rsvp.guest_names.replace(/\s+/g, ', ')})` : + `${rsvp.guest_count} (${Array.isArray(rsvp.guest_names) ? + rsvp.guest_names.join(', ') : + typeof rsvp.guest_names === 'string' ? + rsvp.guest_names.replace(/\s+/g, ', ') : + 'No names provided'})` : 'No' }