Skip to content

Commit e38d7de

Browse files
authored
Merge pull request #1127 from microting/copilot/fix-broken-unit-test
Fix broken unit test by updating RxJS catchError operators to RxJS 7+ API
2 parents 674a24e + d972502 commit e38d7de

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

eform-client/src/app/plugins/modules/time-planning-pn/components/plannings/time-planning-actions/download-excel/download-excel-dialog.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export class DownloadExcelDialogComponent implements OnInit, OnDestroy {
6464
this.downloadReportSub$ = this.workingHoursService
6565
.downloadReport(model)
6666
.pipe(catchError(
67-
(error, caught) => {
67+
(error) => {
6868
this.toastrService.error('Error downloading report');
6969
return EMPTY;
7070
}))

eform-client/src/app/plugins/modules/time-planning-pn/modules/working-hours/components/working-hours-header/working-hours-header.component.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {TimePlanningsReportAllWorkersDownloadRequestModel} from '../../../../mod
66
import {saveAs} from 'file-saver';
77
import {ToastrService} from 'ngx-toastr';
88
import {TimePlanningPnWorkingHoursService} from '../../../../services';
9-
import {Subscription} from 'rxjs';
9+
import {EMPTY, Subscription} from 'rxjs';
1010
import {MatIconRegistry} from '@angular/material/icon';
1111
import {DomSanitizer} from '@angular/platform-browser';
1212
import {catchError} from 'rxjs/operators';
@@ -75,9 +75,9 @@ export class WorkingHoursHeaderComponent implements OnInit {
7575
this.downloadReportSub$ = this.workingHoursService
7676
.downloadReport(model)
7777
.pipe(catchError(
78-
(error, caught) => {
78+
(error) => {
7979
this.toastrService.error('Error downloading report');
80-
return caught;
80+
return EMPTY;
8181
}))
8282
.subscribe(
8383
(data) => {
@@ -113,9 +113,9 @@ export class WorkingHoursHeaderComponent implements OnInit {
113113
this.downloadReportSub$ = this.workingHoursService
114114
.downloadReportAllWorkers(model)
115115
.pipe(catchError(
116-
(caught) => {
116+
(error) => {
117117
this.toastrService.error('Error downloading report');
118-
return caught;
118+
return EMPTY;
119119
}))
120120
.subscribe(
121121
(data) => {

0 commit comments

Comments
 (0)