openaire-library/utils/indexInfo.service.ts

26 lines
775 B
TypeScript
Raw Normal View History

import {Injectable} from '@angular/core';
import {HttpClient} from '@angular/common/http';
import {EnvProperties} from './properties/env-properties';
import {Observable, of} from "rxjs";
import {catchError} from "rxjs/operators";
@Injectable({
providedIn: "root"
})
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
getLastIndexDate(properties: EnvProperties): Observable<any> {
let url = properties.indexInfoAPI + "claim_load_date";
return this.http.get(url).pipe(catchError(err => {return of(null)}));
}
}