Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private configureOptions(){
- this.currentUser = this.authenticationService.currentUserValue;
- this.httpOptions = {
- headers: new HttpHeaders(),
- responseType: 'blob' as 'json'
- };
- this.httpOptions.headers = this.httpOptions.headers.append('Authorization-User', this.currentUser['id']);
- this.httpOptions.headers = this.httpOptions.headers.append('Authorization-Company', this.currentUser.company['id']);
- this.httpOptions.headers = this.httpOptions.headers.append('Content-Type', 'application/json');
- }
- private handleError<T> (operation = 'operation', result?: T) {
- return (error: any): Observable<T> => {
- // TODO: send the error to remote logging infrastructure
- console.error(error); // log to console instead
- // Let the app keep running by returning an empty result.
- return of(result as T);
- };
- }
- //////////////////////////// ///////////////////// ////////////////////
- loadReport (filterVM: any): Observable<any> {
- ////////// ////////////////////////
- return this.http.post<any>(apiUrl + "/Report/Load", filterVM, this.httpOptions).pipe(
- tap((filterVM: any) => console.log(`loading report`)),
- catchError(this.handleError<any>('loadReport'))
- );
- }
Add Comment
Please, Sign In to add comment