Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,9 @@ function CertiniaDefaultVendorPage({policy}: WithPolicyConnectionsProps) {
);

const selectVendor = (row: VendorListItem) => {
if (row.value !== exportConfig?.vendorAccount && policyID) {
updateFinancialForceDefaultVendor(policyID, row.value, exportConfig?.vendorAccount ?? null);
if (policyID) {
const newValue = row.value === exportConfig?.vendorAccount ? '' : row.value;
Comment thread
Beamanator marked this conversation as resolved.
Outdated
updateFinancialForceDefaultVendor(policyID, newValue, exportConfig?.vendorAccount ?? null);
}
Navigation.goBack(backPath);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ function DynamicSageIntacctDefaultVendorPage() {

const updateDefaultVendor = useCallback(
({value}: SelectorType) => {
if (value !== defaultVendor) {
updateSageIntacctDefaultVendor(policyID, settingName, value, defaultVendor);
}
const newValue = value === defaultVendor ? '' : value;
Comment thread
Beamanator marked this conversation as resolved.
Outdated
updateSageIntacctDefaultVendor(policyID, settingName, newValue, defaultVendor);
goBack();
},
[defaultVendor, policyID, settingName, goBack],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,9 @@ function DynamicNetSuiteExportExpensesVendorSelectPage({policy}: WithPolicyConne

const updateDefaultVendor = useCallback(
({value}: SelectorType) => {
if (config?.defaultVendor !== value && policyID) {
updateNetSuiteDefaultVendor(policyID, value, config?.defaultVendor);
if (policyID) {
const newValue = value === config?.defaultVendor ? '' : value;
Comment thread
Beamanator marked this conversation as resolved.
Outdated
updateNetSuiteDefaultVendor(policyID, newValue, config?.defaultVendor);
}
goBack();
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ function QuickbooksDesktopNonReimbursableDefaultVendorSelectPage({policy}: WithP

const selectVendor = useCallback(
(row: CardListItem) => {
if (row.value !== nonReimbursableBillDefaultVendor) {
updateQuickbooksDesktopNonReimbursableBillDefaultVendor(policyID, row.value, nonReimbursableBillDefaultVendor);
}
const newValue = row.value === nonReimbursableBillDefaultVendor ? (CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE as string) : row.value;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as string cast here looks unnecessary.

updateQuickbooksDesktopNonReimbursableBillDefaultVendor(policyID, newValue, nonReimbursableBillDefaultVendor);
Navigation.goBack();
},
[nonReimbursableBillDefaultVendor, policyID],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ function QuickbooksNonReimbursableVendorSelectPage({policy, configKey, updateVen
})) ?? [];

const selectVendor = (row: CardListItem) => {
if (row.value !== currentVendor) {
updateVendor(policyID, row.value, currentVendor);
}
const newValue = row.value === currentVendor ? CONST.INTEGRATION_ENTITY_MAP_TYPES.NONE : row.value;
updateVendor(policyID, newValue, currentVendor);
Navigation.goBack();
};

Expand Down
Loading