mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-01-17 23:29:42 -06:00
Added dependency array and catch block
This commit is contained in:
@@ -40,12 +40,17 @@ const Register = () => {
|
||||
});
|
||||
|
||||
useEffect(() => {
|
||||
axios.get(BASE_URL + "/auth/users/admin").then((response) => {
|
||||
if (response.data.data === true) {
|
||||
navigate("/login");
|
||||
}
|
||||
});
|
||||
});
|
||||
axios
|
||||
.get(BASE_URL + "/auth/users/admin")
|
||||
.then((response) => {
|
||||
if (response.data.data === true) {
|
||||
navigate("/login");
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}, [navigate]);
|
||||
|
||||
useEffect(() => {
|
||||
const { error } = registerValidation.validate(form, {
|
||||
|
||||
Reference in New Issue
Block a user