Commit b2e6ee2e by Tobin

Merge branch 'jensa' into 'master'

Jensa See merge request !26
parents 81a483d0 fab431ee
...@@ -205,20 +205,30 @@ export class DashboardComponent implements OnInit { ...@@ -205,20 +205,30 @@ export class DashboardComponent implements OnInit {
this.loader = true; this.loader = true;
this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => { this.webService.post_data('getCustBookDetails', {'customer_id':this.loginDetails.customer_id}).subscribe(response => {
if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) { if ( response.status == '1' && response.bookData != 'undefined' && response.bookData != undefined && response.bookData != 'null' && response.bookData != null ) {
this.bookingDetails = response.bookData; let bookings = response.bookData;
let successBooking: any[] = new Array(); let successBooking: any[] = new Array();
let bookingDetails: any[] = new Array();
this.bookingDetails.forEach(function (booking) { bookings.forEach(function (book) {
if(booking.status == 1){ if(book.status == 0 || book.status == 1 || book.status == 6){
successBooking.push(booking); successBooking.push(book);
} else {
bookingDetails.push(book);
} }
}); });
if(successBooking.length > 0){ if(successBooking.length > 0){
this.successBookDtls = successBooking; this.successBookDtls = successBooking;
} else { } else {
this.successBookDtls = false; this.successBookDtls = false;
} }
if(bookingDetails.length > 0){
this.bookingDetails = bookingDetails;
} else {
this.bookingDetails = false;
}
} }
this.loader = false; this.loader = false;
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment