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


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


    constructor(private http: HttpClient) {
    }

    url = `${environment.HOST}/`;
    endpoint: string = 'cretenciondet';


    saveObject(obj): Observable<any> {
        return this.http.post(this.url + this.endpoint + '/guardarCretencionDet', obj);
    }

    getAll(): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/listarCretencionDetl');
    }

    getById(key): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/buscarPorIdCretencionDet/' + key);
    }

    deleteObject(key): Observable<any> {
        return this.http.delete(this.url + this.endpoint + '/eliminarCretencionDet/' + key);
    }

    listaDetalleXidComp(key): Observable<any> {
        return this.http.get(this.url + this.endpoint + '/listarDetalleXidComprobante/' + key);
    }
}
