25 lines
828 B
TypeScript
25 lines
828 B
TypeScript
import {Injectable} from "@angular/core";
|
|
import {HttpClient} from "@angular/common/http";
|
|
import {properties} from "../../../environments/environment";
|
|
import {Observable} from "rxjs";
|
|
import {CustomOptions} from "../../openaireLibrary/services/servicesUtils/customOptions.class";
|
|
import {map} 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<Report>(properties.domain + properties.baseLink + '/cache/' + alias, {}, CustomOptions.registryOptions());
|
|
}
|
|
|
|
getReport(alias: string) {
|
|
return this.http.get<Report>(properties.domain + properties.baseLink + '/cache/' + alias, CustomOptions.registryOptions());
|
|
}
|
|
}
|