From ccb7ccfd458c36855573783d3d1bd6c283e8430e Mon Sep 17 00:00:00 2001 From: Eric Fernandez Date: Thu, 12 Sep 2019 11:42:58 -0300 Subject: [PATCH] =?UTF-8?q?fix=20l=C3=ADmite=20articulos=20al=20escanear?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/components/inicio/inicio.component.ts | 2 +- src/app/components/sidebar/sidebar.component.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/components/inicio/inicio.component.ts b/src/app/components/inicio/inicio.component.ts index a2d8475..c0f0b7e 100644 --- a/src/app/components/inicio/inicio.component.ts +++ b/src/app/components/inicio/inicio.component.ts @@ -79,7 +79,7 @@ export class InicioComponent implements OnInit, AfterViewInit { if (res.length === 0) { - this.productoAcargar.cantidad = 1; + this.productoAcargar.cantidad ? false : this.productoAcargar.cantidad = 1; this.productoService.setProductos(this.productoAcargar); this.productoAcargar = this.productoService.productoAcargar = undefined; } else { diff --git a/src/app/components/sidebar/sidebar.component.ts b/src/app/components/sidebar/sidebar.component.ts index 06d1195..dcb0d26 100644 --- a/src/app/components/sidebar/sidebar.component.ts +++ b/src/app/components/sidebar/sidebar.component.ts @@ -73,6 +73,7 @@ export class SidebarComponent implements OnInit { this.cantTotal -= producto.cantidad; this.total -= producto.PreVen * producto.cantidad; + delete producto.cantidad; this.productosCarrito.splice(index, 1); return; } -- 1.9.1