forked from sanchezvem/PyroFetes
MAJ avec l'ajout de la gestion d'authentification
This commit is contained in:
@@ -17,7 +17,6 @@ public class GetProductEndpoint(PyroFetesDbContext db)
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/products/{@id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
public override async Task HandleAsync(GetProductRequest req, CancellationToken ct)
|
||||
@@ -25,7 +24,7 @@ public class GetProductEndpoint(PyroFetesDbContext db)
|
||||
// Inclure toutes les relations : Prices + WarehouseProducts + Warehouse
|
||||
var product = await db.Products
|
||||
.Include(p => p.Prices)
|
||||
.Include(p => p.WarehouseProducts)
|
||||
.Include(p => p.WarehouseProducts)!
|
||||
.ThenInclude(wp => wp.Warehouse)
|
||||
.SingleOrDefaultAsync(p => p.Id == req.Id, ct);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user