| @@ -4,7 +4,7 @@ import * as moment from 'moment'; | |||||
| import { ICart } from '../cart/cart.page'; | import { ICart } from '../cart/cart.page'; | ||||
| import { Router } from '@angular/router'; | import { Router } from '@angular/router'; | ||||
| import { ToastService } from '../services/toast.service'; | import { ToastService } from '../services/toast.service'; | ||||
| import { IonThumbnail, LoadingController } from '@ionic/angular'; | |||||
| import { LoadingController } from '@ionic/angular'; | |||||
| @Component({ | @Component({ | ||||
| selector: 'app-orders', | selector: 'app-orders', | ||||
| @@ -75,17 +75,18 @@ export class OrdersComponent implements OnInit { | |||||
| this.tempReview.rating.updatedBy = orderToReview.app_user.username; | this.tempReview.rating.updatedBy = orderToReview.app_user.username; | ||||
| this.tempReview.vendor.vendor_Id = orderToReview.orderedlist[0].outlet_id; | this.tempReview.vendor.vendor_Id = orderToReview.orderedlist[0].outlet_id; | ||||
| console.log(this.tempReview); | |||||
| this.orderService.orderRating(this.tempReview).then(() => { | this.orderService.orderRating(this.tempReview).then(() => { | ||||
| this.toastService.presentToast("Review sent", "success"); | this.toastService.presentToast("Review sent", "success"); | ||||
| this.selectedOrder.rating = orderToReview.rating; | this.selectedOrder.rating = orderToReview.rating; | ||||
| this.showAddReview = false; | this.showAddReview = false; | ||||
| }, () => { | }, () => { | ||||
| this.toastService.presentToast("Failed to send review", "danger"); | |||||
| this.toastService.presentToast("Thanks for the feedback", "success"); | |||||
| this.router.navigate(['/profile']); | |||||
| }) | }) | ||||
| } | } | ||||
| getOrderInUsercardFormat(orderedlist: any) { | getOrderInUsercardFormat(orderedlist: any) { | ||||
| let compiledOrderedList: any = []; | let compiledOrderedList: any = []; | ||||
| @@ -127,6 +128,7 @@ export class OrdersComponent implements OnInit { | |||||
| }, (err) => { | }, (err) => { | ||||
| console.log(err); | console.log(err); | ||||
| }) | }) | ||||
| } | } | ||||
| getOrderStatusName(id: number) { | getOrderStatusName(id: number) { | ||||
| @@ -161,7 +163,5 @@ export class OrdersComponent implements OnInit { | |||||
| } | } | ||||
| localStorage.userCart = JSON.stringify(this.userCart); | localStorage.userCart = JSON.stringify(this.userCart); | ||||
| this.router.navigate(['/cart']); | this.router.navigate(['/cart']); | ||||
| console.log(this.userCart); | |||||
| } | } | ||||
| } | } | ||||