import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { environment } from 'src/environments/environment';
import { debug } from 'util';


let header = new HttpHeaders();
header = header.set('Content-Type', 'application/json; charset=utf-8');
@Injectable({
  providedIn: 'root'
})
export class RecorderrorreportService {

  baseUrl: string = environment.serviceUrl;
  constructor(private httpClient: HttpClient) { }

  GetRecordErrorReport(data: any): Observable<any> {
    return this.httpClient.post(this.baseUrl + 'api/ReportApi/GetRecordErrorReport',
        data, { headers: header, observe: 'response' });
}
Recorderrorfile_Download(prodefid,path): Observable<any> {
  return this.httpClient.post(this.baseUrl + 'api/ReportApi/Recorderrorfile_download?projecdefid='
  + prodefid + '&path='+ path, { headers: header, observe: 'response' });
}

Image_download(prodefid,path,filename): Observable<any> {
  return this.httpClient.get(this.baseUrl + 'api/ReportApi/Image_download?projecdefid='
  + prodefid + '&path='+ path+'&filename='+filename, { headers: header, observe: 'response' });
}

}
