From ebe792a87531f4fc1c27aa5126dcf259a409e12f Mon Sep 17 00:00:00 2001 From: Jack Nam Date: Tue, 10 Sep 2024 16:44:27 -0700 Subject: [PATCH] Show report field violations --- src/libs/actions/IOU.ts | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/libs/actions/IOU.ts b/src/libs/actions/IOU.ts index fe4e650aeaf9..aec502934e1b 100644 --- a/src/libs/actions/IOU.ts +++ b/src/libs/actions/IOU.ts @@ -879,6 +879,12 @@ function buildOnyxDataForMoneyRequest( return [optimisticData, successData, failureData]; } + if (PolicyUtils.isPaidGroupPolicy(policy)) { + const {optimisticData: fieldViolationsOptimisticData, failureData: fieldViolationsFailureData} = getFieldViolationsOnyxData(iouReport); + optimisticData.push(...fieldViolationsOptimisticData); + failureData.push(...fieldViolationsFailureData); + } + const violationsOnyxData = ViolationsUtils.getViolationsOnyxData( transaction, [], @@ -1642,13 +1648,6 @@ function buildOnyxDataForTrackExpense( }); } - // Show field violations only for control policies - if (PolicyUtils.isControlPolicy(policy) && iouReport) { - const {optimisticData: fieldViolationsOptimisticData, failureData: fieldViolationsFailureData} = getFieldViolationsOnyxData(iouReport); - optimisticData.push(...fieldViolationsOptimisticData); - failureData.push(...fieldViolationsFailureData); - } - return [optimisticData, successData, failureData]; }