This commit is contained in:
2023-10-11 14:38:34 +07:00
parent ed253ea55c
commit 4d037d0b54

View File

@@ -1,40 +1,29 @@
import { Component, OnInit } from "@angular/core"; import { Component, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from "@angular/router"; import { ActivatedRoute, Router } from '@angular/router';
import { AppService } from "../../../app.service"; import { AppService } from '../../../app.service';
import { lastValueFrom } from "rxjs";
import { API } from "../../../@config/app";
@Component({ @Component({
selector: "app-index", selector: 'app-index',
templateUrl: "./index.component.html", templateUrl: './index.component.html',
styleUrls: [] styleUrls: [],
}) })
export class IndexComponent implements OnInit { export class IndexComponent implements OnInit {
title = '';
auth: any = {};
title = ""; constructor(
auth : any = {}; public router: Router,
constructor(public router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
private app: AppService) { private app: AppService
} ) {}
ngOnInit() { ngOnInit() {
this.auth = this.app.auth(); this.auth = this.app.auth();
if (!this.auth) return; if (!this.auth) return;
if (this.auth.userType === 'ADMIN') {
if (this.auth.userType === "ADMIN") { return this.router.navigate(['/pages/manage/kyc']);
return this.router.navigate(["/pages/appraisal/1st-time"]);
} }
return ; return;
} }
} }