import { FormEventHandler } from 'react'; import { makeAPIPostCall } from '../api/utils'; import React, { useState, useEffect } from 'react'; const CreatePool = () => { const [title, setTitle] = useState('No Title'); const [capacity, setCapacity] = useState(0); const [start, setStart] = useState(''); const [end, setEnd] = useState(''); const [direction, setDirection] = useState('pickup'); const [type, setType] = useState('offer'); const [description, setDescription] = useState(''); const onSubmit: FormEventHandler = (e) => { e.preventDefault(); fetch(`${process.env.REACT_APP_API_ENDPOINT}/createPool`) .then((response) => response.json()) .then((data) => { console.log(data); }); }; const onClick = () => { console.log({ title: title, description: description, start_time: start, end_time: end, capacity, direction, type, }); makeAPIPostCall('/pool', { title: title, description: description, start_time: start, end_time: end, capacity, direction, type, }); }; useEffect(() => {}, []); return (

Create Pool

setTitle(event.target.value)} >
setCapacity(parseInt(event.target.value))} >
setStart(event.target.value)} >
setEnd(event.target.value)} >