You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Injectable } from '@angular/core'
|
|
|
|
import { HttpClient, HttpHeaders, HttpParams, HttpRequest } from '@angular/common/http'
|
|
|
|
import { Observable, Subject, throwError } from 'rxjs'
|
|
|
|
import { catchError } from 'rxjs/operators'
|
|
|
|
import { BaseService } from './base-service'
|
|
|
|
import { environment } from '../../environments/environment'
|
|
|
|
|
|
|
|
@Injectable({
|
|
|
|
providedIn: 'root'
|
|
|
|
})
|
|
|
|
export class ApisService extends BaseService {
|
|
|
|
|
|
|
|
private restApi = `${environment.API_URL}`
|
|
|
|
|
|
|
|
constructor(private http: HttpClient) {
|
|
|
|
super()
|
|
|
|
}
|
|
|
|
|
|
|
|
getPortfolio(section): Observable<any> {
|
|
|
|
let urlApi = `${this.restApi}?query=${section}`
|
|
|
|
return this.http.get<any>(urlApi).pipe(
|
|
|
|
catchError(this.handleError)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
getDetails(id): Observable<any> {
|
|
|
|
let urlApi = `${this.restApi}?query=single&id=${id}`
|
|
|
|
return this.http.get<any>(urlApi).pipe(
|
|
|
|
catchError(this.handleError)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|