From f37596edc00a46be1d056be7bb1d3635775562f9 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 26 Mar 2024 15:42:57 -0600 Subject: [PATCH 1/3] fix rogue action --- src/libs/actions/IOU.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index ae3bf0cdbd68..7035b13577c7 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -4634,7 +4634,7 @@ function approveMoneyRequest(expenseReport: OnyxTypes.Report | EmptyObject) { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.reportID}`, value: { - [expenseReport.reportActionID ?? '']: { + [optimisticApprovedReportAction.reportActionID]: { errors: ErrorUtils.getMicroSecondOnyxError('iou.error.other'), }, }, From d5b38947dea86c1e972a79de8a90dd2a3a187f11 Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 26 Mar 2024 18:02:34 -0600 Subject: [PATCH 2/3] rm success data --- src/libs/actions/IOU.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index 7035b13577c7..b67e44fcf5ad 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -4396,15 +4396,6 @@ function getPayMoneyRequestParams(chatReport: OnyxTypes.Report, iouReport: OnyxT ]; const successData: OnyxUpdate[] = [ - { - onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${iouReport.reportID}`, - value: { - [optimisticIOUReportAction.reportActionID]: { - pendingAction: null, - }, - }, - }, { onyxMethod: Onyx.METHOD.MERGE, key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`, From e49daece845ed765569946dd5c61aebab95442fe Mon Sep 17 00:00:00 2001 From: Carlos Martins Date: Tue, 26 Mar 2024 18:32:29 -0600 Subject: [PATCH 3/3] fix test --- tests/actions/IOUTest.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/actions/IOUTest.ts b/tests/actions/IOUTest.ts index 33cdefb749ec..c71a88809302 100644 --- a/tests/actions/IOUTest.ts +++ b/tests/actions/IOUTest.ts @@ -1584,7 +1584,6 @@ describe('actions/IOU', () => { reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.IOU && reportAction.originalMessage.type === CONST.IOU.REPORT_ACTION_TYPE.PAY, ) ?? null; expect(payIOUAction).toBeTruthy(); - expect(payIOUAction?.pendingAction).toBeFalsy(); resolve(); },