MAJ routes d'api pour liaison avec front

This commit is contained in:
2025-11-20 14:10:54 +01:00
parent a8d0b99571
commit 157719eae2
49 changed files with 49 additions and 49 deletions

View File

@@ -8,7 +8,7 @@ public class CreateBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/brands"); Post("/brands");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -12,7 +12,7 @@ public class DeleteBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/brands/{@id}", x => new { x.Id }); Delete("/brands/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllBrandsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpo
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/brands"); Get("/brands");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) :Endpoint<G
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/brands/{@id}", x => new { x.Id }); Get("/brands/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class UpdateBrandEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Put("/api/brands/{Id}"); Put("/brands/{Id}");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class CreateClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/classifications"); Post("/classifications");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -12,7 +12,7 @@ public class DeleteClassificationEndpoint(PyroFetesDbContext libraryDbContext) :
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/classifications/{@id}", x => new { x.Id }); Delete("/classifications/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllClassificationsEndpoint(PyroFetesDbContext pyrofetesdbcontext
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/classifications"); Get("/classifications");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext) :E
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/classifications/{@id}", x => new { x.Id }); Get("/classifications/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class UpdateClassificationEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{ {
public override void Configure() public override void Configure()
{ {
Put("/api/classifications"); Put("/classifications");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -9,7 +9,7 @@ public class CreateColorEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoi
{ {
public override void Configure() //Configuration de l'endpoint public override void Configure() //Configuration de l'endpoint
{ {
Post("Api/colors"); //Création d'un endpoint pour créer une couleur avec les données de CreateColorDto Post("/colors"); //Création d'un endpoint pour créer une couleur avec les données de CreateColorDto
AllowAnonymous(); //Laisser passer les requêtes non authentifiées AllowAnonymous(); //Laisser passer les requêtes non authentifiées
} }

View File

@@ -12,7 +12,7 @@ public class DeleteColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Delete("Api/colors/{@id}", x => new { x.Id }); Delete("/colors/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllColorsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpo
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/colors"); Get("/colors");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint<
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/colors/{@id}", x => new { x.Id}); Get("/colors/{@id}", x => new { x.Id});
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -9,7 +9,7 @@ public class UpdateColorEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Put("Api/colors/{@id}", x => new { x.Id }); Put("/colors/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class CreateEffectEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpo
{ {
public override void Configure() public override void Configure()
{ {
Post("Api/effects"); Post("/effects");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -11,7 +11,7 @@ public class DeleteEffectEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpo
{ {
public override void Configure() public override void Configure()
{ {
Delete("Api/effects/{@id}", x => new { x.Id }); Delete("/effects/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllEffectsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endp
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/effects"); Get("/effects");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetEffectEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoint
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/effects/{@id}", x => new { x.Id }); Get("/effects/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -9,7 +9,7 @@ public class UpdateEffectEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpo
{ {
public override void Configure() public override void Configure()
{ {
Put("Api/effects/{@id}", x => new { x.Id }); Put("/effects/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class CreateMaterialEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Post("Api/materials"); Post("/materials");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllMaterialsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : En
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/materials"); Get("/materials");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetMaterialEndpoint(PyroFetesDbContext pyrofetesdbcontext) : Endpoi
{ {
public override void Configure() public override void Configure()
{ {
Get("Api/materials/{@id}", x => new { x.Id }); Get("/materials/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -9,7 +9,7 @@ public class UpdateMaterialEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Put("Api/materials/{@id}", x => new { x.Id }); Put("/materials/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class CreateMovementEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/movements"); Post("/movements");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -12,7 +12,7 @@ public class DeleteMovementEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/Movements/{@id}", x => new { x.Id }); Delete("/Movements/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllMovementsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : En
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/movements"); Get("/movements");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class GetMovementEndpoint(PyroFetesDbContext pyrofetesdbcontext) :Endpoin
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/movements/{@id}", x => new { x.Id }); Get("/movements/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class UpdateMovementEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Put("/api/movements"); Put("/movements");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -11,7 +11,7 @@ public class CreateProductEndpoint(PyroFetesDbContext db)
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/products"); Post("/products");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class DeleteProductEndpoint(PyroFetesDbContext db) : Endpoint<DeleteProdu
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/products/{@id}", x => new { x.Id }); Delete("/products/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -11,7 +11,7 @@ public class GetAllProductsEndpoint(PyroFetesDbContext db)
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/products"); Get("/products");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -16,7 +16,7 @@ public class GetProductEndpoint(PyroFetesDbContext db)
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/products/{@id}", x => new { x.Id }); Get("/products/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class UpdateProductEndpoint(PyroFetesDbContext db)
public override void Configure() public override void Configure()
{ {
// Route HTTP PUT avec un paramètre d'identifiant dans l'URL // 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) // Autorise les requêtes anonymes (sans authentification)
AllowAnonymous(); AllowAnonymous();

View File

@@ -8,7 +8,7 @@ public class CreateProductCategoryEndpoint(PyroFetesDbContext pyrofetesdbcontext
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/productcategories"); Post("/productcategories");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -12,7 +12,7 @@ public class DeleteProductCategoryEndpoint(PyroFetesDbContext pyrofetesdbcontext
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/productcategories/{@id}", x => new { x.Id }); Delete("/productcategories/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -8,7 +8,7 @@ public class GetAllProductCategoriesEndpoint(PyroFetesDbContext pyrofetesdbconte
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/productcategories"); Get("/productcategories");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -14,7 +14,7 @@ public class GetProductCategoryEndpoint(PyroFetesDbContext pyrofetesdbcontext) :
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/productcategory/{@id}", x => new { x.Id }); Get("/productcategory/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -9,7 +9,7 @@ public class UpdateProductCategoryEndpoint(PyroFetesDbContext pyrofetesdbcontext
{ {
public override void Configure() public override void Configure()
{ {
Put("/api/productcategory/{@id}", x => new { x.Id }); Put("/productcategory/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -11,7 +11,7 @@ public class CreateSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/suppliers"); Post("/suppliers");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class DeleteSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/suppliers/{@id}", x => new { x.Id }); Delete("/suppliers/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -11,7 +11,7 @@ public class GetAllSuppliersEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/suppliers"); Get("/suppliers");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -15,7 +15,7 @@ public class GetSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext)
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/suppliers/{@id}", x => new { x.Id }); Get("/suppliers/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -10,7 +10,7 @@ public class UpdateSupplierEndpoint(PyroFetesDbContext pyrofetesdbcontext) : End
{ {
public override void Configure() public override void Configure()
{ {
Put("/api/suppliers/{@id}", x => new { x.Id }); Put("/suppliers/{@id}", x => new { x.Id });
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -10,7 +10,7 @@ public class CreateWarehouseEndpoint(PyroFetesDbContext db)
{ {
public override void Configure() public override void Configure()
{ {
Post("/api/warehouse"); Post("/warehouse");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -13,7 +13,7 @@ public class DeleteWarehouseEndpoint(PyroFetesDbContext db) : Endpoint<DeleteWar
{ {
public override void Configure() public override void Configure()
{ {
Delete("/api/warehouse/{id}"); Delete("/warehouse/{id}");
AllowAnonymous(); AllowAnonymous();
} }
public override async Task HandleAsync(DeleteWarehouseRequest req, CancellationToken ct) public override async Task HandleAsync(DeleteWarehouseRequest req, CancellationToken ct)

View File

@@ -11,7 +11,7 @@ public class GetAllWarehouseEndpoint(PyroFetesDbContext db)
{ {
public override void Configure() public override void Configure()
{ {
Get("/api/warehouses"); Get("/warehouses");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -16,7 +16,7 @@ public class GetWarehouseEndpoint(PyroFetesDbContext db)
public override void Configure() public override void Configure()
{ {
// Pas de "@id" ici, juste {id} // Pas de "@id" ici, juste {id}
Get("/api/warehouses/{Id}"); Get("/warehouses/{Id}");
AllowAnonymous(); AllowAnonymous();
} }

View File

@@ -12,7 +12,7 @@ public class UpdateWarehouseEndpoint(PyroFetesDbContext db)
public override void Configure() public override void Configure()
{ {
// Utilise {id} plutôt que {@id} // Utilise {id} plutôt que {@id}
Put("/api/warehouses/{Id}"); Put("/warehouses/{Id}");
AllowAnonymous(); AllowAnonymous();
} }