diff --git a/src/app/app.component.ts b/src/app/app.component.ts index a629c38..814d4cc 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -10,8 +10,6 @@ export class AppComponent { constructor( public router: Router ) { - if (localStorage.vendor_token) { - this.router.navigate(['shop-details']); - } + } } diff --git a/src/app/dashboard/dashboard.component.ts b/src/app/dashboard/dashboard.component.ts index eccc586..cf3302c 100644 --- a/src/app/dashboard/dashboard.component.ts +++ b/src/app/dashboard/dashboard.component.ts @@ -1,6 +1,5 @@ import { Component, OnInit } from '@angular/core'; import { IFilterOption } from '../models/filter-option'; -import { OrderService } from '../services/order.service'; @Component({ selector: 'app-dashboard', @@ -10,9 +9,7 @@ import { OrderService } from '../services/order.service'; export class DashboardComponent implements OnInit { filterOptions: Array; - constructor( - private orderService: OrderService - ) { } + constructor() { } ngOnInit() { this.filterOptions = [{ @@ -22,8 +19,6 @@ export class DashboardComponent implements OnInit { name: 'Today', id: 'today' }]; - - this.orderService.getOrders(); } } diff --git a/src/app/data/url.ts b/src/app/data/url.ts index e46cac5..47dea52 100644 --- a/src/app/data/url.ts +++ b/src/app/data/url.ts @@ -1 +1 @@ -export const URL = 'http://159.65.153.233:8989/mall-aggregator'; +export const URL = 'https://mallapi.maiora.co/mall-aggregator'; diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts index 62695a1..2dbf6e7 100644 --- a/src/app/login/login.component.ts +++ b/src/app/login/login.component.ts @@ -9,8 +9,9 @@ import { AuthService } from '../services/auth.service'; }) export class LoginComponent implements OnInit { credentials = { - username: '', - password: '' + username: 'ramsesrh', + password: '123456789', + login_type: "vendor" }; errorMessage: string = ''; @@ -24,16 +25,16 @@ export class LoginComponent implements OnInit { } requestAuthentication() { - // this.authService.authenticateUser(this.credentials).then((data: any) => { - // localStorage.vendor_token = data.accessToken; - // this.router.navigate(['shop-details']); - // }, (err: any) => { - // this.errorMessage = err.error.message; - // setTimeout(() => { - // this.errorMessage = ''; - // }, 3000); - // }); - this.router.navigate(['shop-details']); + this.authService.authenticateUser(this.credentials).then((data: any) => { + localStorage.vendor_token = data.access_Token; + localStorage.vendor_info = JSON.stringify(data); + this.router.navigate(['shop-details']); + }, (err: any) => { + this.errorMessage = 'Please check your credentials'; + setTimeout(() => { + this.errorMessage = ''; + }, 3000); + }); } } diff --git a/src/app/orders/orders.component.html b/src/app/orders/orders.component.html index bd6252b..17aafae 100644 --- a/src/app/orders/orders.component.html +++ b/src/app/orders/orders.component.html @@ -15,95 +15,53 @@ - - - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +
Order ID Order Time Items Quantity Amount Payment Status
Order ID Items Pickup Time Quantity Amount Action
545455 2 Min Ago -
8PC Hot & Crispy
-
KFC 4 + 4
-
-
1
-
4
-
-
₹ 750
-
₹ 250
-
Paid Online -
- - -
-
545455 10 Min Ago -
KFC 4 + 4
-
-
1
-
-
₹ 750
-
Paid Online -
Completed
-
545455 0 Min Ago -
KFC 4 + 4
-
-
1
-
-
₹ 750
-
Paid Online -
Cancelled
-
545455 1 Min Ago -
KFC Bucket
-
-
1
-
-
₹ 250
-
COD -
- - -
-
{{ order.orders_id }} +
+ + {{ item.menu_item_name }} + +
+
+
+ {{ getFormattedDate(item.pickup_time, 'DD MMM @ hh:mm a') }} +
+
+
+ {{ item.quantity }} +
+
+
+ ₹ {{ getFixedDecimalPoints(item.total_price) }} +
+
+
+ + +
+
+ {{ getOrderStatus(order.orderstatus.orderstatus_id).orderStatus }} +
+