Admins Chema
Admins Chema
try {
const res = await fetch('/register', {
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify({
username, email, password
})
})
console.log(res.status)
if (res.status === 200 || !res) {
window.alert("Already Used Details")
} else {
window.alert("Registered Successfully");
navigate.push('/login')
}
} catch (error) {
console.log(error);
}
}
return (
<div>
<div className="container shadow my-5">
<div className="row justify-content-end">
<div className="col-md-5 d-flex flex-column align-items-center
text-white justify-content-center form order-2">
<h1 className="display-4 fw-bolder">
Hello, Friend
</h1>
<p className="lead text-center">Enter Your Details to
Register</p>
<h5 className="mb-4">OR</h5>
<NavLink to="/login" className="btn btn-outline-light
rounded-pill pb-2 w-50">Login</NavLink>
</div>
<div className="col-md-6 p-5">