edit registration

This commit is contained in:
smanylov
2026-02-03 15:25:11 +07:00
parent 2adf66baa2
commit 1e199de7b2
6 changed files with 52 additions and 23 deletions
+16
View File
@@ -170,6 +170,8 @@ export async function registration(
const validatedFields = SignupFormSchema.safeParse(dataToValidate);
console.log(`account-type ${accountType}`)
if (!validatedFields.success) {
const errors: Record<string, string> = {}
JSON.parse(validatedFields.error.message).forEach((obj: {
@@ -197,6 +199,19 @@ export async function registration(
};
}
/*
return {
previousState: {
fullName,
email,
password,
confirm_password,
phone,
agree,
...(accountType === 'b2b' && { companyName })
}
}; */
try {
const { fullName, email, password, phone } = validatedFields.data;
const response = await fetch(`${API_BASE_URL}/api/v1/data`, {
@@ -228,6 +243,7 @@ export async function registration(
if (parsed.message_desc === 'Operation successful') {
await createSession(parsed.message_body.token, email as string);
console.log('succes registration');
} else {
throw parsed;
}