fix: showing the error for company name when try to sign up

This commit is contained in:
Pablo Lara
2024-10-14 17:42:30 +02:00
parent d0b54d1950
commit 7f73e26016
+6 -1
View File
@@ -71,7 +71,6 @@ export const AuthForm = ({ type }: { type: string }) => {
if (newUser?.errors && newUser.errors.length > 0) {
newUser.errors.forEach((error: ApiError) => {
const errorMessage = error.detail;
switch (error.source.pointer) {
case "/data/attributes/name":
form.setError("name", { type: "server", message: errorMessage });
@@ -79,6 +78,12 @@ export const AuthForm = ({ type }: { type: string }) => {
case "/data/attributes/email":
form.setError("email", { type: "server", message: errorMessage });
break;
case "/data/attributes/company_name":
form.setError("company", {
type: "server",
message: errorMessage,
});
break;
case "/data/attributes/password":
form.setError("password", {
type: "server",