From 7c801ad76d436f01e8421d353820c0c26c1c118d Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Mon, 9 Sep 2019 10:53:19 -0300 Subject: [PATCH] =?UTF-8?q?filtro=20s=C3=B3lo=20productos=20que=20tienen?= =?UTF-8?q?=20sin=C3=B3nimo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/inicio/inicio.component.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index e2df986..9e32d4b 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -92,8 +92,14 @@ export class InicioComponent implements OnInit, AfterViewInit { confirmarProducto() { - var producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar; + let producto = this.promoAcargar ? this.promoAcargar : this.productoAcargar; + + producto.productos = producto.productos.filter(producto => { + return producto.idSinonimo > 0; + }); + producto.cantidad = producto.cantidad ? producto.cantidad : 1; + this.productoService.setProductos(producto); this.productoService.productoAcargar = this.promoAcargar = this.productoAcargar = undefined; this.productoService.esPromoPersonalizada = false; @@ -147,7 +153,7 @@ export class InicioComponent implements OnInit, AfterViewInit { productosPersonalizados($event: Producto[]) { - var productosPersonalizados = $event; + let productosPersonalizados = $event; this.promoAcargar.productos = productosPersonalizados; this.confirmarProducto(); } -- 1.9.1