btc, btb registration
This commit is contained in:
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user