From 134bfbdb7e9140a6dbc1e5a6f6b3e7ada6a7f889 Mon Sep 17 00:00:00 2001 From: Starstrike Date: Wed, 30 Apr 2025 09:21:16 -0400 Subject: [PATCH] Fix: Handle array type checking in EventAdmin edit dialog --- frontend/src/components/EventAdmin.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/EventAdmin.tsx b/frontend/src/components/EventAdmin.tsx index 5648bd2..5a49b58 100644 --- a/frontend/src/components/EventAdmin.tsx +++ b/frontend/src/components/EventAdmin.tsx @@ -156,7 +156,7 @@ const EventAdmin: React.FC = () => { const { value } = e.target; setEditForm(prev => ({ ...prev, - items_bringing: typeof value === 'string' ? value.split(',') : value, + items_bringing: Array.isArray(value) ? value : [] })); }; @@ -351,11 +351,11 @@ const EventAdmin: React.FC = () => { input={} renderValue={(selected) => ( - {selected.map((value) => ( + {Array.isArray(selected) ? selected.map((value) => ( {value} - ))} + )) : null} )} >