import { HttpHeaders } from '@angular/common/http'; import { Injectable } from '@angular/core'; import { environment } from '../../../environments/environment'; import { ResearcherModel } from '../../models/researcher/ResearcherModel'; import { BaseHttpService } from '../../utilities/cite-http-service-module/base-http.service'; @Injectable() export class ResearcherService { private actionUrl: string; private headers: HttpHeaders; constructor(private http: BaseHttpService) { this.actionUrl = environment.Server + 'researchers/'; this.headers = new HttpHeaders(); this.headers = this.headers.set('Content-Type', 'application/json'); this.headers = this.headers.set('Accept', 'application/json'); } public createResearcher(researcher: ResearcherModel) { return this.http.post(this.actionUrl + 'create', researcher, { headers: this.headers }); } }