Refactored old validation from profile and password forms, fixed alert text

This commit is contained in:
Daniel Cojocea committed 2024-07-15 20:51:18 -04:00
1 parent 2a77c3fc12
commit d39a716ab6
6 files changed
+37 -70

No files matched your search

+12 -12
View File
@@ -40,18 +40,18 @@ const Register = () => {
});
const [errors, setErrors] = useState({});
// useEffect(() => {
// axiosInstance
// .get("/auth/users/admin")
// .then((response) => {
// if (response.data.data === true) {
// navigate("/login");
// }
// })
// .catch((error) => {
// console.log(error);
// });
// }, [form, navigate]);
useEffect(() => {
axiosInstance
.get("/auth/users/admin")
.then((response) => {
if (response.data.data === true) {
navigate("/login");
}
})
.catch((error) => {
console.log(error);
});
}, [form, navigate]);
const handleSubmit = async (e) => {
e.preventDefault();