diff --git a/package.json b/package.json index f8fc7dd..05ea53d 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "react-query": "^3.39.0", "react-router": "^6.3.0", "react-router-dom": "^6.3.0", - "react-scripts": "5.0.0", + "react-scripts": "^5.0.1", "web-vitals": "^2.1.4" }, "scripts": { diff --git a/src/Pages/registrierung.jsx b/src/Pages/registrierung.jsx index 9f8fc6c..f161af7 100644 --- a/src/Pages/registrierung.jsx +++ b/src/Pages/registrierung.jsx @@ -3,8 +3,29 @@ import ButtonPrimary from "../Components/buttonPrimary"; import Eingabefeld from "../Components/eingabefeld"; import bild from "../pizza_logo_dark.png"; import { Link } from "react-router-dom"; +import axios from "axios"; function Registrierung(props) { + const [username, setusername] = useState(); + const [password, setpassword] = useState(); + const [passwordverify, setpasswordverify] = useState(); + + const onsubmit = ( ) => { + if(password != passwordverify) return; + + axios + .post(process.env.REACT_APP_SERVER_IP + "auth/register", { + name: username, + password: password, + organization: 1, + }) + .then((data) => { + console.log(data); + }) + .catch((error) => console.log(error)); + + } + return (