From 135f1d897932be435ae15ecc8168ca6c329ea8bc Mon Sep 17 00:00:00 2001
From: Alberto <alberto@expensify.com>
Date: Thu, 15 Feb 2024 20:40:13 +0100
Subject: [PATCH] Set the error correctly

---
 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 41f7e4101d2a..0c26d7b5fc21 100644
--- a/src/libs/actions/IOU.ts
+++ b/src/libs/actions/IOU.ts
@@ -3679,7 +3679,7 @@ function cancelPayment(expenseReport: OnyxTypes.Report, chatReport: OnyxTypes.Re
             onyxMethod: Onyx.METHOD.MERGE,
             key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${expenseReport.reportID}`,
             value: {
-                [expenseReport.reportActionID ?? '']: {
+                [optimisticReportAction.reportActionID ?? '']: {
                     errors: ErrorUtils.getMicroSecondOnyxError('iou.error.other'),
                 },
             },