Skip to content

Commit 39b5f30

Browse files
HAN-54: unify endpoints (#23)
1 parent 6face97 commit 39b5f30

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

app/main.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,16 +41,4 @@ async def root():
4141
async def calculator(request: RequestSchema):
4242
return controller.handle_sum(request)
4343

44-
45-
""" # Endpoint only for DB conection testing.
46-
@app.post("/device-plant")
47-
async def add_new_device_plant(req: Request,
48-
device_plant: DevicePlantSchema = Body(...)):
49-
try:
50-
req.app.database.add_new(DevicePlant.from_pydantic(device_plant))
51-
return req.app.database.find_device_plant(device_plant.id_device)
52-
except Exception as e:
53-
req.app.database.rollback()
54-
raise e """
55-
5644
app.include_router(api_router)

app/router/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44

55
api_router = APIRouter()
66

7-
api_router.include_router(device_plant, tags=["DevicePlant"], prefix="/device-plant")
8-
api_router.include_router(measurement, tags=["Measurement"], prefix="/measurement")
7+
api_router.include_router(device_plant, tags=["DevicePlant"],
8+
prefix="/measurements/device-plant")
9+
api_router.include_router(measurement, tags=["Measurement"], prefix="/measurements")

0 commit comments

Comments
 (0)