1
|
import {Injectable} from '@angular/core';
|
2
|
import {HttpClient} from '@angular/common/http';
|
3
|
import {EnvProperties} from './properties/env-properties';
|
4
|
import {Observable, of} from "rxjs";
|
5
|
import {catchError} from "rxjs/operators";
|
6
|
|
7
|
|
8
|
@Injectable({
|
9
|
providedIn: "root"
|
10
|
})
|
11
|
export class IndexInfoService {
|
12
|
|
13
|
constructor(private http: HttpClient) {
|
14
|
}
|
15
|
|
16
|
// http://beta.services.openaire.eu/openaire/info/lastLoadDate
|
17
|
// the date when the mining results currently in the public index have been generated: http://beta.services.openaire.eu/openaire/info/lastMiningDate
|
18
|
getLastIndexDate(properties: EnvProperties): Observable<any> {
|
19
|
let url = properties.indexInfoAPI + "claim_load_date";
|
20
|
return this.http.get(url).pipe(catchError(err => {return of(null)}));
|
21
|
}
|
22
|
}
|
23
|
|
24
|
|
25
|
|