Added conditions to check role after connexion and changed guards
This commit is contained in:
@@ -10,6 +10,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
|
||||
import {firstValueFrom} from "rxjs";
|
||||
import {format} from "date-fns";
|
||||
import {FileService} from "../../services/file.service";
|
||||
import {AuthService} from "../../services/auth.service";
|
||||
|
||||
@Component({
|
||||
selector: 'app-deliverery-note-table',
|
||||
@@ -28,9 +29,11 @@ export class DelivereryNoteTable implements OnInit {
|
||||
private deliveryNotesService = inject(DeliverynotesService);
|
||||
private notificationService = inject(NzNotificationService);
|
||||
private fileService = inject(FileService);
|
||||
private authService = inject(AuthService);
|
||||
|
||||
deliveryNotes = signal<GetDeliveryNoteDto[]>([]);
|
||||
deliveryNotesLoading = signal<boolean>(false);
|
||||
admin = signal<boolean>(false);
|
||||
|
||||
modal = viewChild.required<ModalNav>('modalNav');
|
||||
|
||||
@@ -38,6 +41,7 @@ export class DelivereryNoteTable implements OnInit {
|
||||
|
||||
async ngOnInit() {
|
||||
await this.fetchDeliveryNotes();
|
||||
this.admin.set(this.authService.isAdmin());
|
||||
}
|
||||
|
||||
async fetchDeliveryNotes() {
|
||||
|
||||
Reference in New Issue
Block a user