Commit 17b68461c5e5af8e00608f722c0227d3918d9f5e
1 parent
a0a61a274b
Exists in
master
and in
1 other branch
Creado servicio para hacer get de promociones.
Showing
1 changed file
with
10 additions
and
3 deletions
Show diff stats
src/app/services/producto.service.ts
... | ... | @@ -9,7 +9,8 @@ import { Producto } from '../wrappers/producto'; |
9 | 9 | }) |
10 | 10 | export class ProductoService { |
11 | 11 | |
12 | - productos : Producto[] = []; | |
12 | + productos: Producto[] = []; | |
13 | + productoAcargar: Producto; | |
13 | 14 | |
14 | 15 | constructor(private http: HttpClient) { } |
15 | 16 | |
... | ... | @@ -18,9 +19,15 @@ export class ProductoService { |
18 | 19 | return this.http.get(`${appSettings.apiUrl}/articulos`); |
19 | 20 | } |
20 | 21 | |
21 | - setProductos(producto : Producto){ | |
22 | - | |
22 | + setProductos(producto: Producto) { | |
23 | + | |
23 | 24 | this.productos.push(producto); |
24 | 25 | } |
25 | 26 | |
27 | + getPromocion(sector, codigo): Observable<any> { | |
28 | + // var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${sector}/${codigo}`; | |
29 | + var url = `${appSettings.apiUrl}/promociones/incluir-articulo/${3}/${25}`; | |
30 | + return this.http.get(url); | |
31 | + } | |
32 | + | |
26 | 33 | } |