Skip to content

Commit

Permalink
Show report field violations
Browse files Browse the repository at this point in the history
  • Loading branch information
thienlnam committed Sep 10, 2024
1 parent 5224d91 commit ebe792a
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/libs/actions/IOU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
[],
Expand Down Expand Up @@ -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];
}

Expand Down

0 comments on commit ebe792a

Please sign in to comment.