diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index d710c06c0d0d..40403eded27f 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -7060,6 +7060,7 @@ function putOnHold(transactionID: string, comment: string, reportID: string) { */ function unholdRequest(transactionID: string, reportID: string) { const createdReportAction = ReportUtils.buildOptimisticUnHoldReportAction(); + const transactionViolations = allTransactionViolations[`${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`]; const optimisticData: OnyxUpdate[] = [ { @@ -7079,6 +7080,11 @@ function unholdRequest(transactionID: string, reportID: string) { }, }, }, + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`, + value: transactionViolations?.filter((violation) => violation.name !== CONST.VIOLATIONS.HOLD) ?? [], + }, ]; const successData: OnyxUpdate[] = [ @@ -7103,6 +7109,11 @@ function unholdRequest(transactionID: string, reportID: string) { errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('iou.error.genericUnholdExpenseFailureMessage'), }, }, + { + onyxMethod: Onyx.METHOD.SET, + key: `${ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS}${transactionID}`, + value: transactionViolations ?? null, + }, ]; API.write(