Added conditions to check role after connexion and changed guards
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user