diff --git a/src/app/actions/referralsActions.ts b/src/app/actions/referralsActions.ts index b104b44..49dfe8f 100644 --- a/src/app/actions/referralsActions.ts +++ b/src/app/actions/referralsActions.ts @@ -360,6 +360,8 @@ export async function createPayoutRequest( const amount = formData.get('amount') as string || ''; const payoutMethodId = formData.get('payoutMethodId') as string || ''; + console.log('createPayoutRequest'); + try { const response = await fetch(`${API_BASE_URL}/api/payouts/create-request`, { method: 'POST', @@ -379,7 +381,10 @@ export async function createPayoutRequest( } if (response.status === 409) { - throw 'insufficient-funds-to-receive-payment' + const responseText = await response.text(); + if (responseText.includes('Not have money for payout')) { + throw 'insufficient-funds-to-receive-payment' + } } if (response.ok) {