diff --git a/components/EventSelectForm.tsx b/components/EventSelectForm.tsx index 1c849c3..62c031a 100644 --- a/components/EventSelectForm.tsx +++ b/components/EventSelectForm.tsx @@ -74,6 +74,7 @@ export default function EventSelectForm({ setDropdownEvents([...dropdownEvents, event]); setEventId(event.id); setSelectedEventLocations([]); + return event; } function deleteLocation(id: string, eventId: string) { @@ -220,10 +221,11 @@ export default function EventSelectForm({
{ + onSubmit={async (e) => { e.preventDefault(); if (eventToCreate) { - createEvent(eventToCreate); + const newEvent = await createEvent(eventToCreate); + exit(() => router.push(`/home/event/${newEvent.id}`)); } }} >