Update InvoiceController.cs

This commit is contained in:
MarcEricMartel 2022-11-23 16:53:22 -08:00
parent 67016e388f
commit c1d5ffd125

View File

@ -158,6 +158,13 @@ public class InvoiceController : Controller {
return BadRequest();
}
foreach (var prod in prods) {
inv.Products.Add(new() {
Product = prod,
Quantity = sinv.ProdQuant.First(x => x.Key == prod.Id).Value
});
}
if (prods.Count == 0)
return BadRequest("Vous devez inclure au moins un produit à votre commande.");