File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -120,22 +120,25 @@ export async function scrapeAndImportTransactions({companyId, bank}: ScrapeTrans
120120 stdout . mute ( ) ;
121121 if ( existingReconciliation ) {
122122 // Update the single reconciliation transaction
123+ stdout . mute ( ) ;
123124 await actual . updateTransaction ( existingReconciliation . id , reconciliationTxn ) ;
124125 stdout . unmute ( ) ;
125126 log ( 'RECONCILIATION_UPDATED' , { transactionId : existingReconciliation . id } ) ;
126- } else {
127- // Create the reconciliation transaction for the first time
128- const reconciliationResult = await actual . importTransactions (
129- bank . actualAccountId ,
130- [ reconciliationTxn ] ,
131- ) ;
132- stdout . unmute ( ) ;
133127
134- if ( ! reconciliationResult || _ . isEmpty ( reconciliationResult . added ) ) {
135- console . error ( 'Reconciliation errors' , reconciliationResult ?. errors ) ;
136- } else {
137- log ( 'RECONCILIATION_ADDED' , { transactions : reconciliationResult . added . length } ) ;
138- }
128+ return ;
129+ }
130+
131+ // Create the reconciliation transaction for the first time
132+ const reconciliationResult = await actual . importTransactions (
133+ bank . actualAccountId ,
134+ [ reconciliationTxn ] ,
135+ ) ;
136+ stdout . unmute ( ) ;
137+
138+ if ( ! reconciliationResult || _ . isEmpty ( reconciliationResult . added ) ) {
139+ console . error ( 'Reconciliation errors' , reconciliationResult ?. errors ) ;
140+ } else {
141+ log ( 'RECONCILIATION_ADDED' , { transactions : reconciliationResult . added . length } ) ;
139142 }
140143 } catch ( error ) {
141144 console . error ( 'Error' , companyId , error ) ;
You can’t perform that action at this time.
0 commit comments