Skip to content
This repository was archived by the owner on Jan 29, 2025. It is now read-only.

Commit f05b4d7

Browse files
authored
Merge pull request #451 from sinfo/staging
revert error message in CVs' download
2 parents 42492e4 + 582fbe1 commit f05b4d7

File tree

2 files changed

+7
-70
lines changed

2 files changed

+7
-70
lines changed

src/app/user/downloads/downloads.component.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ <h6 class="lead">
3030

3131
<div class="row">
3232
<div class="col-sm-12">
33-
<button (click)="downloadCVs()" class="btn btn-info">
33+
<a href="{{ cvsDownloadUrl }}" target="_blank" class="btn btn-info">
3434
<span class="glyphicon glyphicon-cloud-download"></span>
3535
Download CVs
36-
</button>
36+
</a>
3737
</div>
3838
<div *ngIf="me && me.role === 'company'" class="col-sm-12">
39-
<button (click)="downloadLinksCVs()" class="btn btn-info">
40-
<span class="glyphicon glyphicon-link"></span>
41-
Download Links' CVs
42-
</button>
39+
<a href="{{ linksCVsDownloadUrl }}" target="_blank" class="btn btn-info">
40+
<span class="glyphicon glyphicon-link"></span>
41+
Download Links' CVs
42+
</a>
4343
</div>
4444

4545
</div>

src/app/user/downloads/downloads.component.ts

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ import { environment } from '../../../environments/environment'
99
import { AuthService } from '../../auth/auth.service'
1010
import { EventService } from '../../events/event.service'
1111

12-
import { catchError } from 'rxjs/operators';
13-
import { Observable } from 'rxjs';
14-
15-
16-
import { HttpClient, HttpHeaders, HttpParams} from '@angular/common/http';
17-
1812
@Component({
1913
selector: 'app-downloads',
2014
templateUrl: './downloads.component.html',
@@ -32,8 +26,7 @@ export class DownloadsComponent implements OnInit {
3226
private companyService: CompanyService,
3327
private authService: AuthService,
3428
private eventService: EventService,
35-
private titleService: Title,
36-
private http: HttpClient
29+
private titleService: Title
3730
) { }
3831

3932

@@ -70,60 +63,4 @@ export class DownloadsComponent implements OnInit {
7063
})
7164
}
7265

73-
downloadCVs() {
74-
if (this.cvsDownloadUrl) {
75-
const httpOptions = {
76-
headers: new HttpHeaders({
77-
'Content-Type': 'application/json'
78-
}),
79-
observe: 'response' as 'response'
80-
};
81-
82-
this.http.get(this.cvsDownloadUrl, httpOptions)
83-
.pipe(
84-
catchError(err => {
85-
console.error('Failed to download CVs:', err);
86-
alert('Unable to dowload CVs at this time. When available the team will contact you.');
87-
throw err; // Re-throw the error if needed for further handling
88-
})
89-
)
90-
.subscribe({
91-
next: response => {
92-
// Success, open the download URL
93-
window.open(this.cvsDownloadUrl, '_blank');
94-
}
95-
});
96-
} else {
97-
alert('CV download URL is not available.');
98-
}
99-
}
100-
101-
downloadLinksCVs() {
102-
if (this.linksCVsDownloadUrl) {
103-
const httpOptions = {
104-
headers: new HttpHeaders({
105-
'Content-Type': 'application/json'
106-
}),
107-
observe: 'response' as 'response'
108-
};
109-
110-
this.http.get(this.linksCVsDownloadUrl, httpOptions)
111-
.pipe(
112-
catchError(err => {
113-
console.error('Failed to download linked CVs:', err);
114-
alert('Unable to dowload links CVs at this time. When available the team will contact you.');
115-
throw err; // Re-throw the error if needed for further handling
116-
})
117-
)
118-
.subscribe({
119-
next: response => {
120-
// Success, open the download URL
121-
window.open(this.linksCVsDownloadUrl, '_blank');
122-
}
123-
});
124-
} else {
125-
alert('Links CV download URL is not available.');
126-
}
127-
}
128-
12966
}

0 commit comments

Comments
 (0)