forked from sanchezvem/PyroFetes
MAJ routes d'api pour liaison avec front
This commit is contained in:
@@ -11,7 +11,7 @@ public class CreateProductEndpoint(PyroFetesDbContext db)
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Post("/api/products");
|
||||
Post("/products");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class DeleteProductEndpoint(PyroFetesDbContext db) : Endpoint<DeleteProdu
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Delete("/api/products/{@id}", x => new { x.Id });
|
||||
Delete("/products/{@id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ public class GetAllProductsEndpoint(PyroFetesDbContext db)
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/products");
|
||||
Get("/products");
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class GetProductEndpoint(PyroFetesDbContext db)
|
||||
{
|
||||
public override void Configure()
|
||||
{
|
||||
Get("/api/products/{@id}", x => new { x.Id });
|
||||
Get("/products/{@id}", x => new { x.Id });
|
||||
AllowAnonymous();
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ public class UpdateProductEndpoint(PyroFetesDbContext db)
|
||||
public override void Configure()
|
||||
{
|
||||
// Route HTTP PUT avec un paramètre d'identifiant dans l'URL
|
||||
Put("/api/products/{@id}", x => new { x.Id });
|
||||
Put("/products/{@id}", x => new { x.Id });
|
||||
|
||||
// Autorise les requêtes anonymes (sans authentification)
|
||||
AllowAnonymous();
|
||||
|
||||
Reference in New Issue
Block a user