@@ -8,6 +8,7 @@ import CONST from '@src/CONST';
88import ONYXKEYS from '@src/ONYXKEYS' ;
99import type { Policy , Report , ReportAction , Transaction , TransactionViolations } from '@src/types/onyx' ;
1010import useArchivedReportsIdSet from './useArchivedReportsIdSet' ;
11+ import useCurrentUserPersonalDetails from './useCurrentUserPersonalDetails' ;
1112import useOnyx from './useOnyx' ;
1213import usePermissions from './usePermissions' ;
1314
@@ -30,6 +31,10 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
3031 const [ policyCategories ] = useOnyx ( `${ ONYXKEYS . COLLECTION . POLICY_CATEGORIES } ${ getNonEmptyStringOnyxID ( report ?. policyID ) } ` , { canBeMissing : true } ) ;
3132 const [ allPolicyRecentlyUsedCategories ] = useOnyx ( ONYXKEYS . COLLECTION . POLICY_RECENTLY_USED_CATEGORIES , { canBeMissing : true } ) ;
3233 const [ allReportNameValuePairs ] = useOnyx ( ONYXKEYS . COLLECTION . REPORT_NAME_VALUE_PAIRS , { canBeMissing : true } ) ;
34+ const currentUserPersonalDetails = useCurrentUserPersonalDetails ( ) ;
35+ const currentUserAccountID = currentUserPersonalDetails . accountID ;
36+ const currentUserLogin = currentUserPersonalDetails . login ?? '' ;
37+ const [ transactionViolations ] = useOnyx ( ONYXKEYS . COLLECTION . TRANSACTION_VIOLATIONS , { canBeMissing : true } ) ;
3338
3439 const { isBetaEnabled} = usePermissions ( ) ;
3540 const archivedReportsIdSet = useArchivedReportsIdSet ( ) ;
@@ -124,6 +129,9 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
124129 iouReport,
125130 firstIOU : originalTransactionIouActions . at ( 0 ) ,
126131 isASAPSubmitBetaEnabled : isBetaEnabled ( CONST . BETAS . ASAP_SUBMIT ) ,
132+ currentUserAccountIDParam : currentUserAccountID ,
133+ currentUserEmailParam : currentUserLogin ,
134+ transactionViolations,
127135 } ) ;
128136 }
129137
@@ -156,7 +164,21 @@ function useDeleteTransactions({report, reportActions, policy}: UseDeleteTransac
156164
157165 return Array . from ( deletedTransactionThreadReportIDs ) ;
158166 } ,
159- [ reportActions , allTransactions , allReports , report , allReportNameValuePairs , allPolicyRecentlyUsedCategories , policyCategories , policy , archivedReportsIdSet , isBetaEnabled ] ,
167+ [
168+ reportActions ,
169+ allTransactions ,
170+ allReports ,
171+ report ,
172+ allReportNameValuePairs ,
173+ allPolicyRecentlyUsedCategories ,
174+ policyCategories ,
175+ policy ,
176+ archivedReportsIdSet ,
177+ isBetaEnabled ,
178+ currentUserAccountID ,
179+ currentUserLogin ,
180+ transactionViolations ,
181+ ] ,
160182 ) ;
161183
162184 return {
0 commit comments