Skip to content

Commit fc1dc82

Browse files
Fix: Use onyxData prefix for optimisticData/successData/failureData in Split.ts
The isLastTransactionInReport block referenced bare optimisticData, successData, and failureData variables which don't exist in the updateSplitTransactions scope. Changed to onyxData.optimisticData?, onyxData.successData?, and onyxData.failureData? to match the existing pattern in this function. Co-authored-by: Lydia Barclay <lydiabarclay@users.noreply.github.com>
1 parent ab2ca38 commit fc1dc82

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/libs/actions/IOU/Split.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1449,7 +1449,7 @@ function updateSplitTransactions({
14491449
});
14501450
const isLastTransactionInReport = Object.values(allTransactionsList ?? {}).filter((itemTransaction) => itemTransaction?.reportID === expenseReportID).length === 1;
14511451
if (isLastTransactionInReport) {
1452-
optimisticData.push({
1452+
onyxData.optimisticData?.push({
14531453
onyxMethod: Onyx.METHOD.MERGE,
14541454
key: `${ONYXKEYS.COLLECTION.REPORT}${transactionData.reportID}`,
14551455
value: {
@@ -1459,12 +1459,12 @@ function updateSplitTransactions({
14591459
},
14601460
},
14611461
});
1462-
successData.push({
1462+
onyxData.successData?.push({
14631463
onyxMethod: Onyx.METHOD.SET,
14641464
key: `${ONYXKEYS.COLLECTION.REPORT}${transactionData.reportID}`,
14651465
value: null,
14661466
});
1467-
failureData.push({
1467+
onyxData.failureData?.push({
14681468
onyxMethod: Onyx.METHOD.MERGE,
14691469
key: `${ONYXKEYS.COLLECTION.REPORT}${transactionData.reportID}`,
14701470
value: {
@@ -1473,7 +1473,7 @@ function updateSplitTransactions({
14731473
},
14741474
});
14751475
if (expenseReport?.parentReportID && expenseReport?.parentReportActionID) {
1476-
optimisticData.push({
1476+
onyxData.optimisticData?.push({
14771477
onyxMethod: Onyx.METHOD.MERGE,
14781478
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport?.parentReportID}`,
14791479
value: {
@@ -1482,7 +1482,7 @@ function updateSplitTransactions({
14821482
},
14831483
},
14841484
});
1485-
successData.push({
1485+
onyxData.successData?.push({
14861486
onyxMethod: Onyx.METHOD.MERGE,
14871487
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport?.parentReportID}`,
14881488
value: {
@@ -1491,7 +1491,7 @@ function updateSplitTransactions({
14911491
},
14921492
},
14931493
});
1494-
failureData.push({
1494+
onyxData.failureData?.push({
14951495
onyxMethod: Onyx.METHOD.MERGE,
14961496
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport?.parentReportID}`,
14971497
value: {

0 commit comments

Comments
 (0)