@@ -232,7 +232,7 @@ export class RulesService implements RulesServiceInterface { | |||
responseType_ = 'text'; | |||
} | |||
return this.httpClient.get<Array<Rule>>(`${this.configuration.basePath}/rules/admin`, | |||
return this.httpClient.get<Array<Rule>>(`${this.configuration.basePath}/rules/admin/all`, | |||
{ | |||
responseType: <any>responseType_, | |||
withCredentials: this.configuration.withCredentials, |
@@ -5,4 +5,8 @@ | |||
<span [routerLink]="['/admin/create']"> | |||
<mat-icon>add</mat-icon> | |||
</span> | |||
<span *ngIf="isLogedIn()" (click)="logout()"> | |||
<mat-icon>logout</mat-icon> | |||
</span> | |||
</mat-toolbar> |
@@ -1,4 +1,6 @@ | |||
import { Component, OnInit } from '@angular/core'; | |||
import { Router } from '@angular/router'; | |||
import { AuthService } from '../auth/service/auth.service'; | |||
@Component({ | |||
selector: 'app-footer', | |||
@@ -7,9 +9,18 @@ import { Component, OnInit } from '@angular/core'; | |||
}) | |||
export class FooterComponent implements OnInit { | |||
constructor() { } | |||
constructor(protected authService: AuthService, protected router: Router) { } | |||
ngOnInit(): void { | |||
} | |||
isLogedIn (): boolean { | |||
return !!this.authService.user; | |||
} | |||
logout () { | |||
this.authService.logout(); | |||
this.router.navigate(['login']); | |||
} | |||
} |