import React,{useState} from 'react'; import {Routes, Route, useNavigate} from 'react-router-dom'; import Axios from 'axios'; import './Login.css'; import Button from "@mui/material/Button"; import Card from "@mui/material/Card"; import TextField from "@mui/material/TextField"; import FormControlLabel from "@mui/material/FormControlLabel"; import Checkbox from "@mui/material/Checkbox"; import Link from "@mui/material/Link"; import Grid from "@mui/material/Grid"; import Box from "@mui/material/Box"; import Typography from "@mui/material/Typography"; import Container from "@mui/material/Container"; function CreateAccount() { const navigate = useNavigate(); const navigateLogin = () => { navigate('/'); } const [data,setData] = useState({ net_id:"", password:"", first_name:"", last_name:"", }) const {net_id, password, first_name, last_name} = data; const changeHandler = e => { setData({...data,[e.target.name]:[e.target.value]}); } const submitHandler = e => { e.preventDefault(); console.log(data); console.log(net_id[0]) console.log(password[0]) console.log(first_name[0]) console.log(last_name[0]) createAccount(); } const createAccount = () => { Axios.post("http://3.219.93.142:8000/api/signup", {net_id: net_id[0], password: password[0], first_name: first_name[0], last_name: last_name[0]}).then((response) => { console.log(response); }); }; return (
Create Account
); } export default CreateAccount;