Reformatted register so it's the same as everywhere

This commit is contained in:
cami 2021-06-30 00:58:44 +02:00
parent bf93e82d19
commit f79959d531

View file

@ -4,7 +4,7 @@ import "../../App.css";
import Footer from "../../Footer"; import Footer from "../../Footer";
import InputField from "../InputField"; import InputField from "../InputField";
import SubmitField from "../SubmitField"; import SubmitField from "../SubmitField";
import "../Input.css" import "../Input.css";
export default function Login() { export default function Login() {
const [username, setUsername] = useState(""); const [username, setUsername] = useState("");
@ -22,16 +22,15 @@ export default function Login() {
method: "post", method: "post",
body: JSON.stringify(opts), body: JSON.stringify(opts),
}).then((response) => { }).then((response) => {
console.log(response) console.log(response);
if (response.status === 409) { if (response.status === 409) {
/* /*
then is needed twice to get rid of the javascript Promise thing then is needed twice to get rid of the javascript Promise thing
*/ */
response.json().then((resp2) => { response.json().then((resp2) => {
setMessage(resp2.message) setMessage(resp2.message);
}); });
} } else if (response.status === 200) {
else if (response.status === 200) {
//TODO redirect to login #77 or #74 //TODO redirect to login #77 or #74
} }
}); });