mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 21:35:50 +00:00
save
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user