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>) {
|
confirmBoxChangeStatus(successChangeStatus: TemplateRef<any>) {
|
||||||
if (!this.isHaveShipper) {
|
if (this.shipper) {
|
||||||
if (this.shipper == undefined) {
|
this.isHaveShipper = true;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
// console.log(this.isHaveShipper)
|
||||||
else {
|
if (this.isHaveShipper) {
|
||||||
this.orderService.updateOrderShipper(this.userId, this.orderId, this.shipper.id).subscribe(() => {
|
this.orderService.updateOrderShipper(this.userId, this.orderId, this.shipper.id).subscribe(() => {
|
||||||
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||||
this.layer1.hide();
|
this.layer1.hide();
|
||||||
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
||||||
});
|
})
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
this.orderService.updateOrderStatus(this.userId, this.orderId, this.selectedStatus).subscribe((res) => { });
|
||||||
this.layer1.hide();
|
this.layer1.hide();
|
||||||
this.layer1 = this.modalService.show(successChangeStatus, { class: "modal-sm" });
|
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() {
|
decline() {
|
||||||
|
|||||||
Reference in New Issue
Block a user