mirror of
https://github.com/Nezumi-2711/foodify-frontend.git
synced 2026-09-22 13:38:44 +00:00
Update orders.component.ts
This commit is contained in:
@@ -160,23 +160,44 @@ export class OrdersComponent implements OnInit {
|
||||
}
|
||||
|
||||
confirmBoxChangeStatus(successChangeStatus: TemplateRef<any>) {
|
||||
if (!this.isHaveShipper) {
|
||||
if (this.shipper == undefined) {
|
||||
if (this.shipper) {
|
||||
this.isHaveShipper = true;
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
this.orderService.updateOrderShipper(this.userId, this.orderId, this.shipper.id).subscribe(() => {
|
||||
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
this.layer1.hide();
|
||||
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
});
|
||||
}
|
||||
// console.log(this.isHaveShipper)
|
||||
if (this.isHaveShipper) {
|
||||
this.orderService.updateOrderShipper(this.userId, this.orderId, this.shipper.id).subscribe(() => {
|
||||
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
this.layer1.hide();
|
||||
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
})
|
||||
}
|
||||
else {
|
||||
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
this.layer1.hide();
|
||||
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
}
|
||||
|
||||
|
||||
// if (!this.isHaveShipper) {
|
||||
// if (this.shipper != undefined) {
|
||||
// this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
// this.layer1.hide();
|
||||
// this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
// }
|
||||
// else {
|
||||
// this.orderService.updateOrderShipper(this.userId, this.orderId, this.shipper.id).subscribe(() => {
|
||||
// this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
// this.layer1.hide();
|
||||
// this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// else {
|
||||
// this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||
// this.layer1.hide();
|
||||
// this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||
// }
|
||||
}
|
||||
|
||||
decline() {
|
||||
|
||||
Reference in New Issue
Block a user