// src/pages/AddObject.js import React, { useState } from 'react'; import { Link } from 'react-router-dom'; import useAuth from '../contexts/useAuth'; import axios from 'axios'; const AddObject = () => { const auth = useAuth(); const [title, setTitle] = useState(''); const [description, setDescription] = useState(''); const handleSubmit = async e => { e.preventDefault(); try { await axios.post('/api/add-object', { title, description }); // сюда ваш endpoint alert("Объект успешно добавлен!"); } catch (err) { console.error(err.response ? err.response.data : err.message); } }; return (

Добавить объект

setTitle(e.target.value)} />