Skip to content

Commit

Permalink
Remove invalid call trying to set reimbursableExpensesExportDestinati…
Browse files Browse the repository at this point in the history
…on to undefined
  • Loading branch information
aldo-expensify committed May 2, 2024
1 parent e8dba5b commit 14afd15
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 10 deletions.
2 changes: 1 addition & 1 deletion src/libs/actions/connections/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ function updatePolicyConnectionConfig<TConnectionName extends ConnectionName, TS
policyID: string,
connectionName: TConnectionName,
settingName: TSettingName,
settingValue?: Partial<Connections[TConnectionName]['config'][TSettingName]>,
settingValue: Partial<Connections[TConnectionName]['config'][TSettingName]>,
) {
const optimisticData: OnyxUpdate[] = [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,8 @@ function QuickbooksOutOfPocketExpenseEntitySelectPage({policy}: WithPolicyConnec
const {reimbursableExpensesExportDestination, syncTax, syncLocations} = policy?.connections?.quickbooksOnline?.config ?? {};
const isLocationsEnabled = Boolean(syncLocations && syncLocations !== CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE);
const isTaxesEnabled = Boolean(syncTax);
const isTaxError = isTaxesEnabled && reimbursableExpensesExportDestination === CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY;
const isLocationError = isLocationsEnabled && reimbursableExpensesExportDestination !== CONST.QUICKBOOKS_REIMBURSABLE_ACCOUNT_TYPE.JOURNAL_ENTRY;
const policyID = policy?.id ?? '';

useEffect(() => {
if (!isTaxError && !isLocationError) {
return;
}
Connections.updatePolicyConnectionConfig(policyID, CONST.POLICY.CONNECTIONS.NAME.QBO, CONST.QUICK_BOOKS_CONFIG.REIMBURSABLE_EXPENSES_EXPORT_DESTINATION);
}, [policyID, isTaxError, isLocationError]);

const data: CardListItem[] = useMemo(
() => [
{
Expand Down

0 comments on commit 14afd15

Please sign in to comment.