2019-07-23 14:23:12 +02:00
|
|
|
import {Injectable} from '@angular/core';
|
|
|
|
import {HttpClient} from '@angular/common/http';
|
|
|
|
import {EnvProperties} from './properties/env-properties';
|
2020-05-19 17:33:47 +02:00
|
|
|
import {Observable, of} from "rxjs";
|
|
|
|
import {catchError} from "rxjs/operators";
|
2019-07-23 14:23:12 +02:00
|
|
|
|
|
|
|
|
2020-05-19 17:33:47 +02:00
|
|
|
@Injectable({
|
|
|
|
providedIn: "root"
|
|
|
|
})
|
2019-07-23 14:23:12 +02:00
|
|
|
export class IndexInfoService {
|
|
|
|
|
|
|
|
constructor(private http: HttpClient) {
|
|
|
|
}
|
|
|
|
|
|
|
|
// http://beta.services.openaire.eu/openaire/info/lastLoadDate
|
|
|
|
// the date when the mining results currently in the public index have been generated: http://beta.services.openaire.eu/openaire/info/lastMiningDate
|
2020-05-19 17:33:47 +02:00
|
|
|
getLastIndexDate(properties: EnvProperties): Observable<any> {
|
|
|
|
let url = properties.indexInfoAPI + "claim_load_date";
|
|
|
|
return this.http.get(url).pipe(catchError(err => {return of(null)}));
|
2019-07-23 14:23:12 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|