Skip to content

Commit

Permalink
Merge pull request Expensify#39021 from Expensify/cmartins-fixRogueAc…
Browse files Browse the repository at this point in the history
…tion

Fix rogue action
  • Loading branch information
yuwenmemon authored Mar 27, 2024
2 parents 2faf908 + e49daec commit 7005b02
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
11 changes: 1 addition & 10 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`,
Expand Down Expand Up @@ -4634,7 +4625,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'),
},
},
Expand Down
1 change: 0 additions & 1 deletion tests/actions/IOUTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
},
Expand Down

0 comments on commit 7005b02

Please sign in to comment.