Tuer des bébés
This commit is contained in:
@@ -3,9 +3,11 @@ using GrossesMitainesAPI.Models;
|
||||
using System.Linq;
|
||||
using GrossesMitainesAPI.Data;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.AspNetCore.Cors;
|
||||
|
||||
namespace GrossesMitainesAPI.Controllers;
|
||||
|
||||
[EnableCors("_myAllowSpecificOrigins")]
|
||||
[ApiController, Route("api/[controller]")]
|
||||
public class InventoryController : Controller {
|
||||
private readonly ILogger<InventoryController> _logger;
|
||||
@@ -16,6 +18,7 @@ public class InventoryController : Controller {
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[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) {
|
||||
const int AMOUNT = 5;
|
||||
@@ -98,6 +101,7 @@ public class InventoryController : Controller {
|
||||
}
|
||||
|
||||
// Inventory/Delete => Décrémenter un produit.
|
||||
[EnableCors("_myAllowSpecificOrigins")]
|
||||
[HttpDelete(Name = "Inventory")]
|
||||
public void Delete(int? id) {
|
||||
if (!id.HasValue) {
|
||||
|
Reference in New Issue
Block a user