import { Injectable } from '@angular/core';
import { Observable } from "rxjs";
import { HttpClient, HttpHeaders, HttpParams, } from "@angular/common/http";
import { ApiRequestService } from "src/app/services/api/api-request.service";
import { environment } from 'src/environments/environment';
@Injectable({
  providedIn: 'root'
})
export class stepperservice{
  private StepperURL = "Stepper_table_config/Stepper_table_config";
  private Adv2URL = "Adv2/Adv2" ;  constructor(
    private http: HttpClient,
    private apiRequest: ApiRequestService,
  ) { }
gettabledata(id: number): Observable<any> {
    const _http = this.StepperURL + "/stepId/" + id;
    return this.apiRequest.get(_http);
  }

  saveStepperConfig(stepperId: number, tableId: number, tableName: string): Observable<any> {
    const params = new HttpParams()
      .set('stepperId', stepperId.toString())
      .set('tableId', tableId.toString())
      .set('tableName', tableName);

    return this.apiRequest.post(this.StepperURL, null, params); // null body, params used
  }  getAllAdv2(page?: number, size?: number): Observable<any> {
    return this.apiRequest.get(this.Adv2URL);
  }
  getAdv2ById(id: number): Observable<any> {
    const _http = this.Adv2URL + "/" + id;
    return this.apiRequest.get(_http);
  }
  createAdv2(data: any): Observable<any> {
    return this.apiRequest.post(this.Adv2URL, data);
  }
  updateAdv2(id: number, data: any): Observable<any> {
    const _http = this.Adv2URL + "/" + id;
    return this.apiRequest.put(_http, data);
  }
  deleteAdv2(id: number): Observable<any> {
    const _http = this.Adv2URL + "/" + id;
    return this.apiRequest.delete(_http);
  }




getAlldynamic(): Observable<any> {   
return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1");  }

getAlldyanmic_mul(): Observable<any> {   return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1");  }

getAllautocom(): Observable<any> {   return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1");  }

getAllauto_mul(): Observable<any> {   return this.apiRequest.get("Testlist_ListFilter1/Testlist_ListFilter1");  }

// updateaction
}