Refactor code

This commit is contained in:
2026-05-28 10:52:46 +01:00
parent 7041c5335b
commit d37ff4ace4
31 changed files with 132 additions and 353 deletions
@@ -76,7 +76,7 @@ export class StockTable implements OnInit {
);
this.products.set(productsWithQuantity);
} catch {
this.notificationService.error('Erreur', 'Erreur de communication avec l\'API');
this.notificationService.error('Erreur', 'Impossible de charger le catalogue');
}
this.productsLoading.set(false);
}
@@ -93,7 +93,7 @@ export class StockTable implements OnInit {
async edit(id: number, updateProductComponent: StockForm) {
if (updateProductComponent.stockForm.invalid) {
this.notificationService.error('Erreur', 'Erreur d\'écriture dans le formulaire')
this.notificationService.error('Erreur', 'Formulaire invalide')
return;
}
try {
@@ -115,7 +115,7 @@ export class StockTable implements OnInit {
if (!this.selectedProduct) return;
await this.edit(productId, updateProductComponent);
updateProductComponent.stockForm.reset();
modal.isVisible = false;
this.onModalCancel(modal);
await this.fetchProducts();
}