import { Injectable } from '@angular/core';
import { AuthenticationService } from 'src/app/hmg-common/services/authentication/authentication.service';
import { ConnectorService } from 'src/app/hmg-common/services/connector/connector.service';
import { Observable } from 'rxjs';
import { SpecialistResponse } from '../models/specialist.response';

@Injectable({
  providedIn: 'root'
})
export class MySpecialistService {

  public static getUserInfo = 'Services/ERP.svc/REST/Get_UserInformation'; //submitter Info

  constructor(public authService: AuthenticationService, public con: ConnectorService) { }

  public getUserInformation(item: any, onError?: any, errorLabel?: string): Observable<SpecialistResponse> {
    const request = item;
    this.authService.authenticateRequest(request);
    return this.con.post(MySpecialistService.getUserInfo, request, onError, errorLabel);
  }
}
