Fixed error to function to create purchase order
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user