import { useState, useEffect, FormEventHandler } from 'react'; import { useParams } from 'react-router-dom'; import { makeAPIGetCall } from '../api/utils'; const UpdatePool = () => { const id = useParams<{ id: string }>().id; // eslint-disable-next-line const [pool, setPool] = useState({ id: 1, pool_title: 'TJ Carpool', pool_text: 'Carpool from TJ track to homes', start_time: '4/10/2021 3:00 PM', end_time: '4/10/2021 4:00 PM', capacity: 2, participants: [], comments: ['What is the covid vaccination status of all the participants?'], }); const onSubmit: FormEventHandler = (e) => { e.preventDefault(); makeAPIGetCall(`/pools/${id}`).then((res) => { console.log(res); }); }; useEffect(() => { makeAPIGetCall(`/pools/${id}`).then((res) => { if (res.data.data) setPool(res.data.data); }); }, [id]); return (

Update Pool


); }; export default UpdatePool;