Skip to content

Commit 0a17c65

Browse files
committed
Update iou report action
1 parent 42aebb5 commit 0a17c65

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

src/libs/actions/Report.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5137,6 +5137,18 @@ function moveIOUReportToPolicy(reportID: string, policyID: string, isFromSettlem
51375137
value: {[movedReportAction.reportActionID]: null},
51385138
});
51395139

5140+
const movedIOUReportAction = buildOptimisticMovedReportAction(iouReport.policyID, policyID, expenseChatReportId, iouReportID, policyName, true);
5141+
optimisticData.push({
5142+
onyxMethod: Onyx.METHOD.MERGE,
5143+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
5144+
value: {[movedIOUReportAction.reportActionID]: movedIOUReportAction},
5145+
});
5146+
failureData.push({
5147+
onyxMethod: Onyx.METHOD.MERGE,
5148+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`,
5149+
value: {[movedIOUReportAction.reportActionID]: null},
5150+
});
5151+
51405152
const parameters: MoveIOUReportToExistingPolicyParams = {
51415153
iouReportID,
51425154
policyID,
@@ -5390,6 +5402,18 @@ function moveIOUReportToPolicyAndInviteSubmitter(reportID: string, policyID: str
53905402
value: {[movedReportAction.reportActionID]: null},
53915403
});
53925404

5405+
const movedIOUReportAction = buildOptimisticMovedReportAction(iouReport.policyID, policyID, optimisticPolicyExpenseChatReportID, iouReportID, policy.name, true);
5406+
optimisticData.push({
5407+
onyxMethod: Onyx.METHOD.MERGE,
5408+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
5409+
value: {[movedIOUReportAction.reportActionID]: movedIOUReportAction},
5410+
});
5411+
failureData.push({
5412+
onyxMethod: Onyx.METHOD.MERGE,
5413+
key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${oldChatReportID}`,
5414+
value: {[movedIOUReportAction.reportActionID]: null},
5415+
});
5416+
53935417
const parameters: MoveIOUReportToPolicyAndInviteSubmitterParams = {
53945418
iouReportID: reportID,
53955419
policyID,

0 commit comments

Comments
 (0)