commentaire endpoint

This commit is contained in:
2025-11-05 22:38:55 +01:00
parent 4c0e7df9de
commit 3c32baac57
45 changed files with 475 additions and 479 deletions

View File

@@ -15,8 +15,8 @@ public class GetSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{
public override void Configure()
{
Get("/api/suppliers/{@id}", x => new { x.Id });
AllowAnonymous();
Get("/api/suppliers/{@id}", x => new { x.Id }); //endpoint qui affiche le fournisseur en fonction de l'id
AllowAnonymous(); //Autorise l'accès sans authentification
}
public override async Task HandleAsync(GetSupplierRequest req, CancellationToken ct)
@@ -28,8 +28,8 @@ public class GetSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext)
if (supplier == null)
{
Console.WriteLine($"Aucun fournisseur avec l'ID {req.Id} trouvé.");
await Send.NotFoundAsync(ct);
return;
await Send.NotFoundAsync(ct); //Renvoie une erreur 404
return; //Arrêt de la méthode
}
var responseDto = new GetSupplierDto