Fix TypeScript error in EventAdmin by adding UpdateFormData interface

This commit is contained in:
Ryderjj89
2025-05-26 13:23:12 -04:00
parent ec747a9761
commit 5f08039fd9

View File

@@ -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<string | null>(null);
const [updateInfoDialogOpen, setUpdateInfoDialogOpen] = useState(false);
const [updateForm, setUpdateForm] = useState({
const [updateForm, setUpdateForm] = useState<UpdateFormData>({
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(() => {