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
@@ -14,6 +14,7 @@ import {NzNotificationService} from "ng-zorro-antd/notification";
import {firstValueFrom} from "rxjs";
import {FileService} from "../../services/file.service";
import {QuantityForm} from "../quantity-form/quantity-form";
import {AuthService} from "../../services/auth.service";
@Component({
selector: 'app-quotation-table',
@@ -34,15 +35,18 @@ export class QuotationTable implements OnInit {
private quotationsService = inject(QuotationsService);
private notificationService = inject(NzNotificationService);
private fileService = inject(FileService);
private authService = inject(AuthService);
quotations = signal<GetQuotationDto[]>([]);
quotationsLoading = signal<boolean>(false);
admin = signal<boolean>(false);
modal = viewChild.required<ModalNav>('modalNav');
modalQuantity = viewChild.required<ModalNav>('modalQuantity');
async ngOnInit() {
await this.fetchQuotations();
this.admin.set(this.authService.isAdmin());
}
async fetchQuotations() {