diff --git a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts b/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts index f8d887fec47a..5bb51f22d64a 100644 --- a/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts +++ b/src/libs/actions/ReimbursementAccount/resetFreePlanBankAccount.ts @@ -2,7 +2,6 @@ import type {OnyxCollection, OnyxEntry} from 'react-native-onyx'; import Onyx from 'react-native-onyx'; import * as API from '@libs/API'; import {WRITE_COMMANDS} from '@libs/API/types'; -import {getDefaultCompanyWebsite} from '@libs/BankAccountUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import INPUT_IDS from '@src/types/form/ReimbursementAccountForm'; @@ -18,7 +17,7 @@ Onyx.connect({ /** * Reset user's reimbursement account. This will delete the bank account. */ -function resetFreePlanBankAccount(bankAccountID: number | undefined, session: OnyxEntry, policyID: string, user: OnyxEntry) { +function resetFreePlanBankAccount(bankAccountID: number | undefined, session: OnyxEntry, policyID: string) { if (!bankAccountID) { throw new Error('Missing bankAccountID when attempting to reset free plan bank account'); } @@ -98,7 +97,7 @@ function resetFreePlanBankAccount(bankAccountID: number | undefined, session: On [INPUT_IDS.BUSINESS_INFO_STEP.STATE]: '', [INPUT_IDS.BUSINESS_INFO_STEP.ZIP_CODE]: '', [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_PHONE]: '', - [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_WEBSITE]: getDefaultCompanyWebsite(session, user), + [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_WEBSITE]: undefined, [INPUT_IDS.BUSINESS_INFO_STEP.COMPANY_TAX_ID]: '', [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_TYPE]: '', [INPUT_IDS.BUSINESS_INFO_STEP.INCORPORATION_DATE]: '', diff --git a/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx b/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx index 541e47f6cb10..a425c776f63d 100644 --- a/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx +++ b/src/pages/ReimbursementAccount/BusinessInfo/substeps/WebsiteBusiness.tsx @@ -1,4 +1,4 @@ -import React, {useCallback, useEffect, useMemo} from 'react'; +import React, {useCallback, useMemo} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; import {withOnyx} from 'react-native-onyx'; import FormProvider from '@components/Form/FormProvider'; @@ -12,7 +12,6 @@ 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'; @@ -59,10 +58,6 @@ function WebsiteBusiness({reimbursementAccount, user, session, onNext, isEditing shouldSaveDraft: isEditing, }); - useEffect(() => { - BankAccounts.addBusinessWebsiteForDraft(defaultCompanyWebsite); - }, [defaultCompanyWebsite]); - return ( ; - - /** The user's data */ - user: OnyxEntry; }; type WorkspaceResetBankAccountModalProps = WorkspaceResetBankAccountModalOnyxProps & { @@ -23,7 +20,7 @@ type WorkspaceResetBankAccountModalProps = WorkspaceResetBankAccountModalOnyxPro reimbursementAccount: OnyxEntry; }; -function WorkspaceResetBankAccountModal({reimbursementAccount, session, user}: WorkspaceResetBankAccountModalProps) { +function WorkspaceResetBankAccountModal({reimbursementAccount, session}: WorkspaceResetBankAccountModalProps) { const styles = useThemeStyles(); const {translate} = useLocalize(); const achData = reimbursementAccount?.achData; @@ -49,7 +46,7 @@ function WorkspaceResetBankAccountModal({reimbursementAccount, session, user}: W } danger onCancel={BankAccounts.cancelResetFreePlanBankAccount} - onConfirm={() => BankAccounts.resetFreePlanBankAccount(bankAccountID, session, achData?.policyID ?? '-1', user)} + onConfirm={() => BankAccounts.resetFreePlanBankAccount(bankAccountID, session, achData?.policyID ?? '-1')} shouldShowCancelButton isVisible /> @@ -62,7 +59,4 @@ export default withOnyx