Fixed error to function to create purchase order

This commit is contained in:
2026-05-27 12:20:25 +01:00
parent 56d3d1bea7
commit a7ef707388
10 changed files with 118 additions and 75 deletions
@@ -41,7 +41,7 @@ export class StockTable implements OnInit {
modal = viewChild.required<ModalNav>('modalNav');
selectionChange = output<number[]>();
productsTables = output<ProductWithQuantity[]>();
productsTables = output<GetProductDto[]>();
selectedProduct: GetProductDto | null = null;
checked: boolean = false;
@@ -56,6 +56,7 @@ export class StockTable implements OnInit {
this.productsLoading.set(true);
try {
const products = await firstValueFrom(this.productsService.getAllProductsEndpoint());
this.productsTables.emit(products);
const productsWithQuantity = await Promise.all(
products.map(async (x) => {
@@ -74,7 +75,6 @@ export class StockTable implements OnInit {
})
);
this.products.set(productsWithQuantity);
this.productsTables.emit(productsWithQuantity);
} catch {
this.notificationService.error('Erreur', 'Erreur de communication avec l\'API');
}