diff options
| author | Luiz Gustavo Monteiro <luizgu_mreis@hotmail.com> | 2025-11-03 23:39:34 -0300 |
|---|---|---|
| committer | Luiz Gustavo Monteiro <luizgu_mreis@hotmail.com> | 2025-11-03 23:39:34 -0300 |
| commit | f392c3edaf52ccfa496d2e85f96e18ec81d11a65 (patch) | |
| tree | 17f15971a209936a774c9a313938452d986a89b5 /api/routes/sensors.py | |
| parent | e987f732a7ad2d85a5760061a20873b841c10fac (diff) | |
refactor Post methods in schema files
Diffstat (limited to 'api/routes/sensors.py')
| -rw-r--r-- | api/routes/sensors.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/api/routes/sensors.py b/api/routes/sensors.py index d1c4403..9c86309 100644 --- a/api/routes/sensors.py +++ b/api/routes/sensors.py @@ -2,7 +2,7 @@ from fastapi import APIRouter, HTTPException from sqlalchemy import select from ..database import SessionLocal from ..models import SensorDevice, Station -from pydantic import BaseModel +from ..schemas.sensor import PostSensor from datetime import datetime router = APIRouter( @@ -29,11 +29,6 @@ async def get_sensors(): session.close() return dc -class PostSensor(BaseModel): - name: str - installation_date: int | None = None - station_id: int - @router.post('/') async def post_sensor(sensor: PostSensor): session = SessionLocal() |
