diff --git a/src/app/order/order.component.ts b/src/app/order/order.component.ts index 3b408c6..6f74da7 100644 --- a/src/app/order/order.component.ts +++ b/src/app/order/order.component.ts @@ -124,7 +124,7 @@ export class OrderComponent implements OnInit{ this.notifierService .showNotification("Order successfully cancelled!", "Close","success"); - });; + }); } else { console.log('Returning to page'); } @@ -227,6 +227,12 @@ export class OrderComponent implements OnInit{ // + " => (" + item.name +")"); this.orderService.updateOrder(item.line_id,lines); this.orderService.getOrder(); + if ( this.order.lines.length == 0 ) { + this.orderService.cancelOrder(this.order._id!) + .subscribe((response) => { + this.orderService.getOrder(); + }); + } } else { console.log('Returning to order');