Update InvoiceController.cs
This commit is contained in:
		| @@ -158,6 +158,10 @@ public class InvoiceController : Controller { | ||||
|             return BadRequest(); | ||||
|         } | ||||
|  | ||||
|         | ||||
|         if (prods.Count == 0) | ||||
|             return BadRequest("Vous devez inclure au moins un produit à votre commande."); | ||||
|  | ||||
|         foreach (var prod in prods) { | ||||
|             inv.Products.Add(new() { | ||||
|                 Product = prod, | ||||
| @@ -165,9 +169,6 @@ public class InvoiceController : Controller { | ||||
|             }); | ||||
|         } | ||||
|  | ||||
|         if (prods.Count == 0) | ||||
|             return BadRequest("Vous devez inclure au moins un produit à votre commande."); | ||||
|  | ||||
|         foreach (var prod in sinv.ProdQuant) { // Update de quantités dans l'inventaire. | ||||
|             ProductModel inventProd = prods.Where(x => x.Id == prod.Key).First(); | ||||
|             if (inventProd.Quantity < prod.Value) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user