feat(1099): add authenticated blob downloads to report API service
Add downloadCsv/downloadCopyB returning Blob via HttpClient so the auth interceptor attaches the bearer token (raw window.open would 401). Remove the now-unused copyBUrl/exportCsvUrl raw-URL builders. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -30,11 +30,19 @@ export class Form1099ReportApiService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
copyBUrl(payeeId: number, taxYear: number): string {
|
// Authenticated blob downloads: routed through HttpClient so the auth
|
||||||
return `${this.endpoint}/recipient/${payeeId}/copy-b?taxYear=${taxYear}`;
|
// interceptor attaches the bearer token (a raw window.open would 401).
|
||||||
|
downloadCsv(taxYear: number): Observable<Blob> {
|
||||||
|
return this.http.get(`${this.endpoint}/export-csv`, {
|
||||||
|
params: { taxYear: String(taxYear) },
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
exportCsvUrl(taxYear: number): string {
|
downloadCopyB(payeeId: number, taxYear: number): Observable<Blob> {
|
||||||
return `${this.endpoint}/export-csv?taxYear=${taxYear}`;
|
return this.http.get(`${this.endpoint}/recipient/${payeeId}/copy-b`, {
|
||||||
|
params: { taxYear: String(taxYear) },
|
||||||
|
responseType: 'blob',
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user