punto-venta.service.ts
751 Bytes
import { Injectable } from '@angular/core';
import { Observable } from 'rxjs/internal/Observable';
import { appSettings } from 'src/etc/AppSettings';
import { HttpClient } from '@angular/common/http';
@Injectable({
providedIn: 'root'
})
export class PuntoVentaService {
private apiAutoservico = appSettings.apiUrl;
constructor(
private http: HttpClient
) { }
getAll(): Observable<any> {
return this.http.get(`${this.apiAutoservico}/get/puntos-venta`);
}
getByID(id: number): Observable<any> {
return this.http.get(`${this.apiAutoservico}/get/punto-venta/${id}`);
}
getVendedor(filter: any = {}): Observable<any> {
return this.http.get(`${this.apiAutoservico}/get/vendedor/${JSON.stringify(filter)}`);
}
}