btc, btb registration

This commit is contained in:
smanylov
2026-01-29 14:34:04 +07:00
parent 832c4b0e76
commit 8b68e37b89
6 changed files with 147 additions and 42 deletions
+9 -5
View File
@@ -135,7 +135,7 @@ export type FormState = {
password: string;
confirm_password: string;
phone: string;
companyName: string;
companyName?: string;
agree: string;
},
mailConfirm?: boolean,
@@ -146,6 +146,10 @@ export async function registration(
state: FormState | undefined,
formData: FormData,
): Promise<FormState> {
const registrationType = formData.get('accoutType') as string || '';
console.log(registrationType);
const fullName = formData.get('fullName') as string || '';
const email = formData.get('email') as string || '';
const password = formData.get('password') as string || '';
@@ -163,7 +167,7 @@ export async function registration(
password,
confirm_password,
agree,
companyName
...(registrationType === 'btb' && { companyName })
};
const validatedFields = SignupFormSchema.safeParse(dataToValidate);
@@ -188,8 +192,8 @@ export async function registration(
password,
confirm_password,
phone,
companyName,
agree
agree,
...(registrationType === 'btb' && { companyName })
},
error: errors
};
@@ -207,7 +211,7 @@ export async function registration(
email,
phone: phone,
password,
companyName: companyName,
...(registrationType === 'btb' && { companyName: companyName })
}
}),
headers: {