This commit is contained in:
tiago.kayaya
2021-04-08 09:14:28 +01:00
parent 8a4f296f96
commit a87fd0b6ed
9 changed files with 124 additions and 30 deletions
+10 -2
View File
@@ -3,7 +3,8 @@ import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { AuthService } from '../services/auth.service';
import { User } from '../models/user.model';
import { Observable } from 'rxjs';
import { Observable, throwError } from 'rxjs';
import { catchError } from 'rxjs/operators'
@Injectable({
providedIn: 'root'
@@ -80,7 +81,8 @@ export class PublicationsService {
headers: this.headers,
params: params
};
return this.http.get<any>(`${geturl}`, options);
return this.http.get<any>(`${geturl}`, options)
.pipe(catchError(this.handleError));
}
GetPublicationById( publicationId:any){
@@ -140,6 +142,12 @@ export class PublicationsService {
handleError(error){
return throwError(error || 'Server Error');
}
}