fix payout error handler
This commit is contained in:
@@ -385,6 +385,10 @@ export async function createPayoutRequest(
|
||||
if (responseText.includes('Not have money for payout')) {
|
||||
throw 'insufficient-funds-to-receive-payment'
|
||||
}
|
||||
|
||||
if (responseText.includes('Not found payout method')) {
|
||||
throw 'not-found-payout-method'
|
||||
}
|
||||
}
|
||||
|
||||
if (response.ok) {
|
||||
@@ -415,6 +419,9 @@ export async function createPayoutRequest(
|
||||
case 'insufficient-funds-to-receive-payment':
|
||||
typedError = 'insufficient-funds-to-receive-payment';
|
||||
break;
|
||||
case 'not-found-payout-method':
|
||||
typedError = 'not-found-payout-method';
|
||||
break
|
||||
default:
|
||||
typedError = 'payment-error';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user