feat(payment receive & made): handle error.

This commit is contained in:
elforjani13
2022-03-17 14:34:24 +02:00
parent 7f3a494c8d
commit b0407168a0
10 changed files with 105 additions and 30 deletions

View File

@@ -2,7 +2,8 @@ import React from 'react';
import moment from 'moment';
import intl from 'react-intl-universal';
import { first, isEqual } from 'lodash';
import { Intent } from '@blueprintjs/core';
import { AppToaster } from 'components';
import { useFormikContext } from 'formik';
import { useQuickPaymentMadeContext } from './QuickPaymentMadeFormProvider';
@@ -31,6 +32,12 @@ export const transformErrors = (errors, { setFieldError }) => {
intl.get('the_payment_amount_bigger_than_invoice_due_amount'),
);
}
if (getError('WITHDRAWAL_ACCOUNT_CURRENCY_INVALID')) {
AppToaster.show({
message: intl.get('payment_made.error.withdrawal_account_currency_invalid'),
intent: Intent.DANGER,
});
}
};
export const useSetPrimaryBranchToForm = () => {