diff options
-rw-r--r-- | src/containers/BsuFantomSection/EventForm.tsx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/containers/BsuFantomSection/EventForm.tsx b/src/containers/BsuFantomSection/EventForm.tsx index e52dc5d..de3adc7 100644 --- a/src/containers/BsuFantomSection/EventForm.tsx +++ b/src/containers/BsuFantomSection/EventForm.tsx @@ -9,7 +9,7 @@ interface PropTypes { const EventForm: React.FC<PropTypes> = ({ mutate }) => { const [name, setName] = useState<string>(''); - const [date, setDate] = useState<string>(''); + const [date, setDate] = useState<string>((new Date()).toLocaleDateString()); const [attendanceId, setAttendanceId] = useState<string>(''); const [conferenceId, setConferenceId] = useState<string>(''); @@ -26,6 +26,12 @@ const EventForm: React.FC<PropTypes> = ({ mutate }) => { conferenceId, participants: [] } + + setName(''); + setAttendanceId(''); + setConferenceId(''); + setDate(''); + return post('/events', event).then(() => mutate()); } } |