From 2310966d1cb2b8587a944fb0d2e45d4b0d03c295 Mon Sep 17 00:00:00 2001 From: Bernhard Owen Josephus Date: Sat, 7 Sep 2024 00:13:07 +0700 Subject: [PATCH] save the default website --- .../BusinessInfo/substeps/WebsiteBusiness.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx b/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx index a2d1f245152f..ed360dc68842 100644 --- a/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx +++ b/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx @@ -1,4 +1,4 @@ -import React, {useCallback, useMemo} from 'react'; +import React, {useCallback, useEffect, useMemo} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; import FormProvider from '@components/Form/FormProvider'; @@ -12,6 +12,7 @@ import type {SubStepProps} from '@hooks/useSubStep/types'; import useThemeStyles from '@hooks/useThemeStyles'; import {getDefaultCompanyWebsite} from '@libs/BankAccountUtils'; import * as ValidationUtils from '@libs/ValidationUtils'; +import * as BankAccounts from '@userActions/BankAccounts'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import INPUT_IDS from '@src/types/form/ReimbursementAccountForm'; @@ -58,6 +59,10 @@ function WebsiteBusiness({reimbursementAccount, user, session, onNext, isEditing shouldSaveDraft: isEditing, }); + useEffect(() => { + BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite); + }, [defaultCompanyWebsite]); + return (