diff --git a/pages/edit.js b/pages/edit.js index 34a818d..c7d2683 100755 --- a/pages/edit.js +++ b/pages/edit.js @@ -6,6 +6,8 @@ import { CSS } from '@dnd-kit/utilities'; + + const UserComponent = ({ id, body diff --git a/pages/signin.js b/pages/signin.js index 4d12881..e73a29a 100644 --- a/pages/signin.js +++ b/pages/signin.js @@ -28,7 +28,7 @@ function LoginSignupForm() { // Use axios to send a POST request to the /login or /signup route // depending on whether the user is trying to login or sign up const res = await axios.post( - '/login', + 'http://localhost:3000/login/signin', body, config ); diff --git a/pages/signup.js b/pages/signup.js index 8d54b59..ddfde6f 100644 --- a/pages/signup.js +++ b/pages/signup.js @@ -3,15 +3,10 @@ import axios from 'axios'; import { Link } from 'react-router-dom'; function SignUpPage() { - const [formData, setFormData] = useState({ - username: '', - password: '', - }); +const [username, setUsername] = useState(""); +const [password, setPassword] = useState(""); - const { username, password } = formData; - const onChange = e => - setFormData({ ...formData, [e.target.name]: e.target.value }); const onSubmit = async e => { e.preventDefault(); @@ -25,16 +20,17 @@ function SignUpPage() { const body = JSON.stringify({ username, password }); try { + console.log("body: ", body); // Use axios to send a POST request to the /signup route const res = await axios.post( - '/register', + 'http://localhost:3001/login/signup', body, config ); console.log(res.data); } catch (err) { - console.error(err.response.data); + console.error(err.response); } }; @@ -47,7 +43,7 @@ function SignUpPage() { src="https://tailwindui.com/img/logos/mark.svg?color=indigo&shade=600" alt="Your Company" /> -