add ref link error, add refill button, update referral invites table
This commit is contained in:
+11
-7
@@ -214,8 +214,8 @@ export async function registration(
|
||||
phone: phone,
|
||||
password,
|
||||
accountType,
|
||||
/* referralLink: referralCode, */
|
||||
...(accountType === 'b2b' && { companyName: companyName })
|
||||
...(accountType === 'b2b' && { companyName: companyName }),
|
||||
...(referralCode !== '' && { referralLink: referralCode })
|
||||
}
|
||||
}),
|
||||
headers: {
|
||||
@@ -230,8 +230,8 @@ export async function registration(
|
||||
phone: phone,
|
||||
password,
|
||||
accountType,
|
||||
/* referralLink: referralCode, */
|
||||
...(accountType === 'b2b' && { companyName: companyName })
|
||||
...(accountType === 'b2b' && { companyName: companyName }),
|
||||
...(referralCode !== '' && { referralLink: referralCode })
|
||||
})
|
||||
|
||||
if (response.ok) {
|
||||
@@ -282,9 +282,13 @@ export async function registration(
|
||||
|
||||
switch (typedError.message_code) {
|
||||
case 1:
|
||||
errors['server'] = 'email-or-already-registered'
|
||||
break;
|
||||
|
||||
if (typedError.message_desc === 'Refferal link is not exist') {
|
||||
errors['server'] = 'referral-link-is-not-exist'
|
||||
break;
|
||||
} else {
|
||||
errors['server'] = 'email-or-already-registered'
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
if (typedError.message_body?.fieldErrors) {
|
||||
typedError.message_body?.fieldErrors?.forEach((obj: {
|
||||
|
||||
Reference in New Issue
Block a user