Skip to content

Commit

Permalink
Show validation to add atleast one payment
Browse files Browse the repository at this point in the history
  • Loading branch information
ODORA0 committed Jun 20, 2024
1 parent 2b06959 commit c757c19
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,14 @@ const AddBillableService: React.FC = () => {
);
};

const getPaymentErrorMessage = () => {
const paymentError = errors.payment;
if (paymentError && typeof paymentError.message === 'string') {
return paymentError.message;
}
return null;
};

return (
<Form className={styles.form}>
<h4>{t('addBillableServices', 'Add Billable Services')}</h4>
Expand Down Expand Up @@ -302,6 +310,7 @@ const AddBillableService: React.FC = () => {
iconDescription="Add">
{t('addPaymentOptions', 'Add payment option')}
</Button>
{getPaymentErrorMessage() && <div className={styles.errorMessage}>{getPaymentErrorMessage()}</div>}
</div>
</section>

Expand Down

0 comments on commit c757c19

Please sign in to comment.