diff --git a/api.py b/api.py index 03f22e7..604f2ee 100644 --- a/api.py +++ b/api.py @@ -1086,7 +1086,7 @@ async def rechercher_articles(query: Optional[str] = Query(None)): logger.error(f"Erreur recherche articles: {e}") raise HTTPException(500, str(e)) -@router.post("/articles", status_code=status.HTTP_201_CREATED, tags=["Articles"]) +@app.post("/articles", status_code=status.HTTP_201_CREATED, tags=["Articles"]) def creer_article(article: ArticleCreateDTO): """ ➕ Création d'un article dans Sage @@ -1116,7 +1116,7 @@ def creer_article(article: ArticleCreateDTO): raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, str(e)) -@router.put("/articles/{reference}", tags=["Articles"]) +@app.put("/articles/{reference}", tags=["Articles"]) def modifier_article(reference: str, article: ArticleUpdateDTO): """ ✏️ Modification d'un article dans Sage @@ -1164,7 +1164,7 @@ def modifier_article(reference: str, article: ArticleUpdateDTO): raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, str(e)) -@router.get("/articles/{reference}", tags=["Articles"]) +@app.get("/articles/{reference}", tags=["Articles"]) def lire_article(reference: str): """ 📄 Lecture d'un article par référence @@ -1189,7 +1189,7 @@ def lire_article(reference: str): raise HTTPException(status.HTTP_500_INTERNAL_SERVER_ERROR, str(e)) -@router.get("/articles/all") +@app.get("/articles/all") def lister_articles(filtre: str = ""): """ 📋 Liste tous les articles avec filtre optionnel