Есть проблема с отправкой данных на сервер. Проблема, что когда отправляю форму мне ни в консоли не выводит: ADDED. И в network не вижу ни один 201 статус
const [directoryName, setDirectoryName] = useState("");
const [parentId, setParentId] = useState("");
const onDirectoryNameChange = event => setDirectoryName(event.target.value);
const onParentIdChange = event => setParentId(event.target.value);
const handleSubmit = event => {
event.preventDefault();
const data = { parentId, directoryName };
const requestOptions = {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data)
};
fetch("http://localhost:8000/directories", requestOptions)
//.then(response => response.json())
//.then(response => console.log(response));
.then(() => console.log("ADDED"));
}
<form action="">
<input
type="text"
value={ directoryName }
onChange={ onDirectoryNameChange }
placeholder='Folder name'
required />
<input
type="text"
value={ parentId }
onChange={ onParentIdChange }
placeholder='Parent id'
required />
<Button
className="foreground center"
label="Create folder"
onClick={ handleSubmit }
/>
</form>