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
|
this.notifierService
|
||||||
.showNotification("Order successfully cancelled!",
|
.showNotification("Order successfully cancelled!",
|
||||||
"Close","success");
|
"Close","success");
|
||||||
});;
|
});
|
||||||
} else {
|
} else {
|
||||||
console.log('Returning to page');
|
console.log('Returning to page');
|
||||||
}
|
}
|
||||||
|
@ -227,6 +227,12 @@ export class OrderComponent implements OnInit{
|
||||||
// + " => (" + item.name +")");
|
// + " => (" + item.name +")");
|
||||||
this.orderService.updateOrder(item.line_id,lines);
|
this.orderService.updateOrder(item.line_id,lines);
|
||||||
this.orderService.getOrder();
|
this.orderService.getOrder();
|
||||||
|
if ( this.order.lines.length == 0 ) {
|
||||||
|
this.orderService.cancelOrder(this.order._id!)
|
||||||
|
.subscribe((response) => {
|
||||||
|
this.orderService.getOrder();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
console.log('Returning to order');
|
console.log('Returning to order');
|
||||||
|
|
Loading…
Reference in a new issue