diff --git a/papi/main.py b/papi/main.py index bd09c0b..a6631d2 100644 --- a/papi/main.py +++ b/papi/main.py @@ -77,8 +77,11 @@ def list_notification(idsonde: str): @app.post("/sonde/{idsonde}/") -def post_sonde_data(idsonde: str, body: dict = Body(...)): - if idsonde not in sondes: +def post_sonde_data( + idsonde: str, body: dict = Body(...), db: Session = Depends(get_db) +): + + if not (sonde := crud.get_sonde(db, idsonde)): return mesures_ = mesures[idsonde]