developers/src/app/services/personal.service.ts

32 lines
896 B
TypeScript

import {Injectable} from "@angular/core";
import {HttpClient} from "@angular/common/http";
import {properties} from "../../environments/environment";
import {CustomOptions} from "../openaireLibrary/services/servicesUtils/customOptions.class";
export interface PersonalInfo {
id: string;
email: string;
name: string;
surname: string;
affiliation: string;
position: string;
}
@Injectable({
providedIn: 'root'
})
export class PersonalService {
constructor(private http: HttpClient) {
}
public getPersonalInfo() {
return this.http.get<PersonalInfo>(properties.developersApiUrl + '/personal/my-info', CustomOptions.registryOptions());
}
public savePersonalInfo(personalInfo: PersonalInfo) {
return this.http.post<PersonalInfo>(properties.developersApiUrl + '/personal/save', personalInfo, CustomOptions.registryOptions());
}
}