Added conditions to check role after connexion and changed guards

This commit is contained in:
2026-06-01 10:41:50 +01:00
parent cf53e4c8ef
commit 80b4726004
22 changed files with 142 additions and 92 deletions
@@ -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() {