stable after blogs

This commit is contained in:
Dhanraj
2024-08-31 19:39:59 +05:30
parent 7b153f4cf6
commit 9c6c3abc32
52 changed files with 10990 additions and 5416 deletions

View File

@ -1,6 +1,6 @@
import {Component, OnDestroy, OnInit} from '@angular/core';
import {Router} from "@angular/router";
import {AuthenticationService} from "../../service/authentication.service";
import {NotificationService} from "../../service/notification.service";
import {NotificationType} from "../../notification/notification-type";
import {Subscription} from "rxjs";
@ -8,6 +8,8 @@ import {UserLogin} from "../../dto/user-login";
import {HttpErrorResponse, HttpResponse} from "@angular/common/http";
import {User} from "../../model/user";
import {HeaderType} from "../../enum/header-type.enum";
import { AuthenticationService } from 'src/app/service/authentication.service';
;
@Component({
selector: 'app-login',
@ -26,7 +28,8 @@ export class LoginComponent implements OnInit, OnDestroy {
ngOnInit(): void {
if (this.authenticationService.isUserLoggedIn()) {
this.router.navigate(["/management", "users"]);
this.router.navigate(["/user", "management"]);
// this.router.navigate(["/management", "users"]);
this.notificationService.notify(NotificationType.INFO, "You are already logged in");
}
}
@ -43,7 +46,8 @@ export class LoginComponent implements OnInit, OnDestroy {
this.authenticationService.addUserToLocalStorage(response.body!);
this.router.navigateByUrl('/management/users');
this.router.navigateByUrl('/home');
// this.router.navigateByUrl('/management/users');
this.showLoading = false;
},
(errorResponse: HttpErrorResponse) => {