diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index c5f3745..197e024 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -31,9 +31,14 @@ export class DashboardComponent implements OnInit { this.orderService.getOrders().then((data) => { this.orderList = data; - this.orderList = this.orderList.filter((order) => { - return order.orderstatus; - }); + for (let i = 0; i < this.orderList.length; i += 1) { + if (!this.orderList[i].orderstatus) { + this.orderList[i].orderstatus = { + orderStatus: "", + orderstatus_id: 6 + } + } + } }, () => { alert("Error getting the orders"); }); diff --git a/src/app/orders/orders.component.ts b/src/app/orders/orders.component.ts index 539294f..704c716 100644 --- a/src/app/orders/orders.component.ts +++ b/src/app/orders/orders.component.ts @@ -60,13 +60,16 @@ export class OrdersComponent implements OnInit { this.orderService.getOrders().then((data) => { this.orderList = data; - this.orderList = this.orderList.filter((order) => { - return order.orderstatus; - }); + for (let i = 0; i < this.orderList.length; i += 1) { + if (!this.orderList[i].orderstatus) { + this.orderList[i].orderstatus = { + orderStatus: "", + orderstatus_id: 6 + } + } + } - this.tempOrderList = this.orderList.filter((order) => { - return order.orderstatus; - }); + this.tempOrderList = JSON.parse(JSON.stringify(this.orderList)); }, () => { alert("Error getting the orders"); }); diff --git a/src/app/widgets-holder/widgets-holder.component.html b/src/app/widgets-holder/widgets-holder.component.html index f4d47af..69c3eee 100644 --- a/src/app/widgets-holder/widgets-holder.component.html +++ b/src/app/widgets-holder/widgets-holder.component.html @@ -1,10 +1,10 @@