forked from sanchezvem/PyroFetes
correction types warehouses, products et suppliers
This commit is contained in:
@@ -20,7 +20,7 @@ public class GetAllProductsEndpoint(PyroFetesDbContext db)
|
||||
// Inclure toutes les relations nécessaires : Prices + WarehouseProducts + Warehouse
|
||||
var products = await db.Products
|
||||
.Include(p => p.Prices)
|
||||
.Include(p => p.WarehouseProducts)
|
||||
.Include(p => p.WarehouseProducts)!
|
||||
.ThenInclude(wp => wp.Warehouse)
|
||||
.ToListAsync(ct);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class GetAllProductsEndpoint(PyroFetesDbContext db)
|
||||
{
|
||||
Id = p.Id,
|
||||
// Le modèle Product contient "Reference" (string) — pas "References" (int)
|
||||
Reference = int.TryParse(p.Reference, out var refInt) ? refInt : 0,
|
||||
Reference = p.Reference,
|
||||
Name = p.Name,
|
||||
Duration = p.Duration,
|
||||
Caliber = p.Caliber,
|
||||
|
||||
Reference in New Issue
Block a user