23 lines
895 B
TypeScript
23 lines
895 B
TypeScript
import {Injectable} from "@angular/core";
|
|
import {HttpClient} from "@angular/common/http";
|
|
import {properties} from "../../environments/environment";
|
|
import {Observable} from "rxjs";
|
|
import {StatsProfile} from "../openaireLibrary/monitor/entities/stakeholder";
|
|
import {CustomOptions} from "../openaireLibrary/services/servicesUtils/customOptions.class";
|
|
|
|
@Injectable({
|
|
providedIn: 'root'
|
|
})
|
|
export class StatsProfilesService {
|
|
|
|
constructor(private http: HttpClient) {
|
|
}
|
|
|
|
getStatsProfile(): Observable<StatsProfile[]> {
|
|
return this.http.get<StatsProfile[]>(properties.monitorServiceAPIURL + '/stats-profiles', CustomOptions.registryOptions());
|
|
}
|
|
|
|
saveStatsProfiles(statsProfiles: StatsProfile[]): Observable<StatsProfile[]> {
|
|
return this.http.post<StatsProfile[]>(properties.monitorServiceAPIURL + '/stats-profiles/bulk', statsProfiles, CustomOptions.registryOptions());
|
|
}
|
|
} |