Prevent duplicate import
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
<h1 mat-dialog-title>{{ data.title }}</h1>
|
||||
<div mat-dialog-content>
|
||||
<div mat-dialog-content style="white-space: pre-wrap">
|
||||
{{ data.content }}
|
||||
</div>
|
||||
<div mat-dialog-actions>
|
||||
|
||||
@ -262,8 +262,9 @@ export class TransactionImportComponent {
|
||||
|
||||
this.importService.execute(req).subscribe({
|
||||
next: (res) => {
|
||||
this.snackBar.open(res.message, 'Close', { duration: 3000 });
|
||||
this.router.navigate(['/daybook']);
|
||||
this.snackBar.open(res.message, 'Close', { duration: 5000 });
|
||||
this.previewRows.set(res.processed_rows || []);
|
||||
this.selection.clear();
|
||||
},
|
||||
error: (err) => {
|
||||
this.snackBar.open('Error importing transactions: ' + err.message, 'Close', { duration: 3000 });
|
||||
|
||||
@ -62,11 +62,12 @@ export class TransactionImportService {
|
||||
}>;
|
||||
}
|
||||
|
||||
execute(request: ImportExecutionRequest): Observable<{ message: string }> {
|
||||
execute(request: ImportExecutionRequest): Observable<{ message: string; processed_rows?: PreviewRow[] }> {
|
||||
return this.http
|
||||
.post<{ message: string }>(`${url}/execute`, request)
|
||||
.post<{ message: string; processed_rows?: PreviewRow[] }>(`${url}/execute`, request)
|
||||
.pipe(catchError(this.log.handleError('TransactionImportService', 'execute'))) as Observable<{
|
||||
message: string;
|
||||
processed_rows?: PreviewRow[];
|
||||
}>;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user