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

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

  baseUrl: string = environment.serviceUrl;

  constructor(private httpClient: HttpClient) { }

  
  Get_all(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/ErrorApi/Getall', {  observe: 'response' });
  }

  singal(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/ErrorApi/demo', {  observe: 'response' });
  }
  Edit_Error(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/ErrorApi/Edit_Error', data,  { observe: 'response' });
  } 
  Active_Error(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/ErrorApi/Active_Error', data,  { observe: 'response' });
  }

  Add_Error(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/ErrorApi/Add_Error', data,  { observe: 'response' });
  }

  RecordErrorCount(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/ErrorApi/RecordErrorCount', data,  { observe: 'response' });
  }
  
  // Get_Errorlst(lotid:number,jobid:number,tranid:number): Observable<any> {
  //   return this.httpClient.get<any>(this.baseUrl + 'api/ErrorApi/Get_Errorlst?jobid=' + jobid+'&lotid='
  //   + lotid+'&tranid=' +tranid, {  observe: 'response' });
  // } 
   Get_Errorlst(): Observable<any> {
    return this.httpClient.get<any>(this.baseUrl + 'api/ErrorApi/Get_Errorlst', {  observe: 'response' });
  }

  saveLobAnswer(data:any[]):Observable<any>{
    return this.httpClient.post<any>(this.baseUrl + 'api/ErrorApi/saveLobAnswer', data,  { observe: 'response' });
  }
}
