diff --git a/src/components/ReportActionItem/MoneyRequestView.js b/src/components/ReportActionItem/MoneyRequestView.js index 86affbcac114..9a48805e16a7 100644 --- a/src/components/ReportActionItem/MoneyRequestView.js +++ b/src/components/ReportActionItem/MoneyRequestView.js @@ -39,6 +39,7 @@ import iouReportPropTypes from '@pages/iouReportPropTypes'; import reportPropTypes from '@pages/reportPropTypes'; import {policyDefaultProps, policyPropTypes} from '@pages/workspace/withPolicy'; import * as IOU from '@userActions/IOU'; +import * as Transaction from '@userActions/Transaction'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import ROUTES from '@src/ROUTES'; @@ -233,7 +234,14 @@ function MoneyRequestView({report, parentReport, parentReportActions, policyCate {hasReceipt && ( - + { + Transaction.clearError(transaction.transactionID); + }} + > ; +type ReceiptError = {error?: string; source: string; filename: string}; + +type ReceiptErrors = Record; + type Transaction = { amount: number; billable: boolean; @@ -56,7 +60,7 @@ type Transaction = { comment: Comment; created: string; currency: string; - errors?: OnyxCommon.Errors; + errors?: OnyxCommon.Errors | ReceiptErrors; errorFields?: OnyxCommon.ErrorFields<'route'>; // The name of the file used for a receipt (formerly receiptFilename) filename?: string; @@ -97,4 +101,4 @@ type Transaction = { }; export default Transaction; -export type {WaypointCollection, Comment, Receipt, Waypoint}; +export type {WaypointCollection, Comment, Receipt, Waypoint, ReceiptError};