Sidebar Bottom Menu #16

Merged
igorpropisnov merged 3 commits from feature/adding-bottom-menu into main 2024-07-18 22:53:50 +02:00
3 changed files with 0 additions and 38 deletions
Showing only changes of commit b0b3fa72e1 - Show all commits

View File

@ -1,38 +0,0 @@
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';
import { SuccessDtoApiModel } from '../../api';
import { AuthService } from '../../shared/service';
@Component({
selector: 'app-foo',
standalone: true,
providers: [],
imports: [],
templateUrl: './home-root.component.html',
styleUrl: './home-root.component.scss',
})
export class HomeComponent implements OnInit {
public constructor(
private readonly authService: AuthService,
private readonly router: Router
) {}
public ngOnInit(): void {
this.authService.status().subscribe(
(response: SuccessDtoApiModel) => {
if (response.success) {
this.router.navigate(['/dashboard']);
}
},
(error: HttpErrorResponse) => {
if (error.status === 401) {
this.router.navigate(['welcome'], {
queryParams: { login: true },
});
}
}
);
}
}