Added check to error details

This commit is contained in:
Daniel Cojocea
2024-07-12 14:08:30 -04:00
parent e4c179f63d
commit f4bd0e7a09
2 changed files with 8 additions and 2 deletions
+4 -1
View File
@@ -78,7 +78,10 @@ const Login = () => {
// validation errors
createToast({
variant: "info",
body: error.details[0].message,
body:
error && error.details && error.details.length > 0
? error.details[0].message
: "Error validating data.",
hasIcon: false,
});
} else if (error.response) {
+4 -1
View File
@@ -95,7 +95,10 @@ const Register = () => {
// validation errors
createToast({
variant: "info",
body: error.details[0].message,
body:
error && error.details && error.details.length > 0
? error.details[0].message
: "Error validating data.",
hasIcon: false,
});
} else if (error.response) {