Refactored old validation from profile and password forms, fixed alert text
This commit is contained in:
1 parent
2a77c3fc12
commit
d39a716ab6
6 files changed
+37
-70
No files matched your search
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user