on registration failed msg

This commit is contained in:
AmitChauhan63390
2024-11-16 23:54:06 +05:30
parent 459daed60c
commit cf5c8b11e9

View File

@@ -43,8 +43,8 @@ const Register = () => {
notify("success", "Registration Successful!"); notify("success", "Registration Successful!");
window.localStorage.setItem("user", JSON.stringify(data)); window.localStorage.setItem("user", JSON.stringify(data));
navigate("/"); navigate("/");
} catch (err) { } catch (error:any) {
notify("error", "Registration Failed. Please try again."); notify("error", error.response.data || "Registration Failed. Please try again.");
setLoading(false); setLoading(false);
} }
}; };