import React, { useState, useEffect } from 'react'; const UpdatePool = (props) => { const id = props.match.params.id; const [state, setState] = 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 callAPI = () => { fetch(`${process.env.REACT_APP_API_ENDPOINT}/pool/${id}`) .then((response) => response.json()) .then((data) => { if (data !== undefined) { setState(data); } }); }; const onSubmit = (e) => { e.preventDefault(); fetch(`${process.env.REACT_APP_API_ENDPOINT}/update_pool`) .then((response) => response.json()) .then((data) => { console.log(data); }); }; useEffect(() => { callAPI(); }, []); return (

Update Pool


); }; export default UpdatePool;