Files
mirror-cathay/src/app/pages/dashboard/index/index.component.ts
2023-10-10 03:58:47 +07:00

41 lines
771 B
TypeScript

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