Refactor code
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user