aboutsummaryrefslogtreecommitdiff
path: root/src/containers
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2020-11-15 05:08:09 +0300
committereug-vs <eug-vs@keemail.me>2020-11-15 05:08:09 +0300
commite49f9442cc1ab348b936d7b524ee16fee78cffea (patch)
tree37ba8cbbaedb486b9a3558aa0ff0da0602e1732c /src/containers
parent32c538a68062c4a6a0293129d21a6fc619b69f32 (diff)
downloadfamcs-kit-e49f9442cc1ab348b936d7b524ee16fee78cffea.tar.gz
feat: clear EventForm after submit
Diffstat (limited to 'src/containers')
-rw-r--r--src/containers/BsuFantomSection/EventForm.tsx8
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());
}
}