Rev=move order when last Item is deleted
This commit is contained in:
parent
2daf62e8f3
commit
75cc66dfef
1 changed files with 7 additions and 1 deletions
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue