A long vacation
This commit is contained in:
@@ -20,7 +20,7 @@ public class InventoryController : Controller {
|
||||
|
||||
[EnableCors("_myAllowSpecificOrigins")]
|
||||
[HttpGet(Name = "Inventory")] // Pour faire des calls async par paquet de AMOUNT (5) (pour du loading en scrollant)
|
||||
public IEnumerable<Product> Get(int? lastId, string? order, string? filterPrice, string? filterState) {
|
||||
public IEnumerable<Product> Get(int? lastId, string? order, string? filterPrice, string? filterState, bool? all) {
|
||||
const int AMOUNT = 5;
|
||||
|
||||
var ret = _context.Products.AsQueryable();
|
||||
@@ -95,6 +95,8 @@ public class InventoryController : Controller {
|
||||
if (prod.Id == lastId)
|
||||
yup = true;
|
||||
}
|
||||
else if (all.HasValue && all == true)
|
||||
lst = ret.ToList();
|
||||
else lst = ret.Take(AMOUNT).ToList();
|
||||
|
||||
return lst;
|
||||
|
Reference in New Issue
Block a user