update registration
This commit is contained in:
@@ -155,7 +155,7 @@ export async function registration(
|
|||||||
const accountType = formData.get('accountType') as 'b2b' | 'b2c';
|
const accountType = formData.get('accountType') as 'b2b' | 'b2c';
|
||||||
|
|
||||||
/* вернуть в true когда проект выйдет из дева */
|
/* вернуть в true когда проект выйдет из дева */
|
||||||
const mail_verified = true;
|
const mail_verified = false;
|
||||||
const fullName = formData.get('fullName') as string || '';
|
const fullName = formData.get('fullName') as string || '';
|
||||||
const email = formData.get('email') as string || '';
|
const email = formData.get('email') as string || '';
|
||||||
const password = formData.get('password') as string || '';
|
const password = formData.get('password') as string || '';
|
||||||
@@ -246,6 +246,8 @@ export async function registration(
|
|||||||
password,
|
password,
|
||||||
accountType,
|
accountType,
|
||||||
mail_verified: mail_verified,
|
mail_verified: mail_verified,
|
||||||
|
ip: ip,
|
||||||
|
user_agent: userAgent,
|
||||||
...(accountType === 'b2b' && { companyName: companyName, inn: inn }),
|
...(accountType === 'b2b' && { companyName: companyName, inn: inn }),
|
||||||
...(referralCode !== '' && { referralLink: referralCode })
|
...(referralCode !== '' && { referralLink: referralCode })
|
||||||
}
|
}
|
||||||
@@ -262,6 +264,8 @@ export async function registration(
|
|||||||
phone: phone,
|
phone: phone,
|
||||||
password,
|
password,
|
||||||
accountType,
|
accountType,
|
||||||
|
ip: ip,
|
||||||
|
user_agent: userAgent,
|
||||||
...(accountType === 'b2b' && { companyName: companyName, inn: inn }),
|
...(accountType === 'b2b' && { companyName: companyName, inn: inn }),
|
||||||
...(referralCode !== '' && { referralLink: referralCode })
|
...(referralCode !== '' && { referralLink: referralCode })
|
||||||
})
|
})
|
||||||
@@ -269,7 +273,7 @@ export async function registration(
|
|||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
let parsed = await response.json() as {
|
let parsed = await response.json() as {
|
||||||
message_desc: string,
|
message_desc: string,
|
||||||
message_body: { token: string, userId: number },
|
message_body: { token: string, userId: number, fieldErrors: string },
|
||||||
message_code: number
|
message_code: number
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user