From 5f08039fd9cc2c91e5b141687d49591fcde91292 Mon Sep 17 00:00:00 2001 From: Ryderjj89 Date: Mon, 26 May 2025 13:23:12 -0400 Subject: [PATCH] Fix TypeScript error in EventAdmin by adding UpdateFormData interface --- frontend/src/components/EventAdmin.tsx | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/frontend/src/components/EventAdmin.tsx b/frontend/src/components/EventAdmin.tsx index 86019bd..e6108e9 100644 --- a/frontend/src/components/EventAdmin.tsx +++ b/frontend/src/components/EventAdmin.tsx @@ -75,6 +75,19 @@ interface EditFormData { other_items: string; } +interface UpdateFormData { + title: string; + description: string; + location: string; + date: string; + rsvp_cutoff_date: string; + wallpaper: File | null; + email_notifications_enabled: boolean; + email_recipients: string; + event_conclusion_email_enabled: boolean; + event_conclusion_message: string; +} + const EventAdmin: React.FC = () => { const { slug } = useParams<{ slug: string }>(); const navigate = useNavigate(); @@ -103,14 +116,17 @@ const EventAdmin: React.FC = () => { const [newItem, setNewItem] = useState(''); const [itemToDelete, setItemToDelete] = useState(null); const [updateInfoDialogOpen, setUpdateInfoDialogOpen] = useState(false); - const [updateForm, setUpdateForm] = useState({ + const [updateForm, setUpdateForm] = useState({ + title: '', description: '', location: '', date: '', rsvp_cutoff_date: '', - wallpaper: null as File | null, + wallpaper: null, email_notifications_enabled: false, - email_recipients: '' + email_recipients: '', + event_conclusion_email_enabled: false, + event_conclusion_message: '' }); useEffect(() => {