react-version #1

Merged
memartel_loc merged 290 commits from react-version into main 2023-11-04 09:48:15 -04:00
Showing only changes of commit 49381ca6f6 - Show all commits

View File

@ -78,14 +78,23 @@ public class InventoryController : Controller {
break;
default: break;
}
if (order is not null && order.Contains("Desc")) {
if (!lastId.HasValue)
lastId = _context.Products.Max(x => x.Id) + 1;
} else
if (!lastId.HasValue)
lastId = _context.Products.Min(x => x.Id) - 1;
List<Product> lst = ret.ToList();
if (lastId.HasValue)
foreach (Product prod in new List<Product>(lst)) {
lst.Remove(prod);
if (prod.Id == lastId)
break;
}
//if (order is not null && order.Contains("Desc")) {
// if (!lastId.HasValue)
// lastId = _context.Products.Max(x => x.Id) + 1;
//} else
// if (!lastId.HasValue)
// lastId = _context.Products.Min(x => x.Id) - 1;
return ret.Where(x => x.Id > lastId).Take(AMOUNT).ToList();
return lst.Take(AMOUNT);
}
// Inventory/Delete => Décrémenter un produit.