Skip to content

Commit

Permalink
Merge pull request #32898 from bernhardoj/fix/31622-revert-edit-amoun…
Browse files Browse the repository at this point in the history
…t-on-failure

Fix money request amount doesn't get reverted when failing to edit
  • Loading branch information
tylerkaraszewski authored Dec 29, 2023
2 parents 2cda438 + d7db85e commit 89d7479
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -2203,17 +2203,28 @@ function editRegularMoneyRequest(transactionID, transactionThreadReportID, trans
},
},
{
onyxMethod: Onyx.METHOD.SET,
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.TRANSACTION}${transactionID}`,
value: transaction,
value: {
...transaction,
modifiedCreated: transaction.modifiedCreated ? transaction.modifiedCreated : null,
modifiedAmount: transaction.modifiedAmount ? transaction.modifiedAmount : null,
modifiedCurrency: transaction.modifiedCurrency ? transaction.modifiedCurrency : null,
modifiedMerchant: transaction.modifiedMerchant ? transaction.modifiedMerchant : null,
modifiedWaypoints: transaction.modifiedWaypoints ? transaction.modifiedWaypoints : null,
pendingFields: null,
},
},
{
onyxMethod: Onyx.METHOD.SET,
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.reportID}`,
value: iouReport,
value: {
...iouReport,
cachedTotal: iouReport.cachedTotal ? iouReport.cachedTotal : null,
},
},
{
onyxMethod: Onyx.METHOD.SET,
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${iouReport.chatReportID}`,
value: chatReport,
},
Expand Down

0 comments on commit 89d7479

Please sign in to comment.