27 lines
920 B
TypeScript
27 lines
920 B
TypeScript
import {Injectable} from "@angular/core";
|
|
import {HttpClient} from "@angular/common/http";
|
|
import {properties} from "../../../environments/environment";
|
|
import {BehaviorSubject, Observable} from "rxjs";
|
|
import {CustomOptions} from "../../openaireLibrary/services/servicesUtils/customOptions.class";
|
|
import {map, tap} from "rxjs/operators";
|
|
import {Report} from "../../../cache-indicators";
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class CacheIndicatorsService {
|
|
|
|
constructor(private http: HttpClient) {
|
|
}
|
|
|
|
createReport(alias: string) {
|
|
return this.http.post<any>(properties.domain + properties.baseLink + '/cache/' + alias, {}, CustomOptions.registryOptions())
|
|
.pipe(map(res => res.report));
|
|
}
|
|
|
|
getReport(alias: string) {
|
|
return this.http.get<any>(properties.domain + properties.baseLink + '/cache/' + alias, CustomOptions.registryOptions())
|
|
.pipe(map(res => res.report));
|
|
}
|
|
}
|