Tuer des bébés

This commit is contained in:
Victor Turgeon
2022-10-18 10:08:23 -04:00
parent 84e6bb9bc3
commit e5377fb35b
5 changed files with 21 additions and 3 deletions

View File

@@ -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) {