From b22bc4e164f59b136ee5f0555cd98349d2711cd7 Mon Sep 17 00:00:00 2001 From: BluemediaGER Date: Sat, 13 Apr 2024 22:55:43 +0200 Subject: [PATCH] Adjust chargepoint path and creation response code --- app/routers/chargepoint_v1.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/routers/chargepoint_v1.py b/app/routers/chargepoint_v1.py index cd768b5..806bdc3 100644 --- a/app/routers/chargepoint_v1.py +++ b/app/routers/chargepoint_v1.py @@ -13,10 +13,10 @@ from app.security import get_api_key router = APIRouter( prefix="/chargepoint", - tags=["chargepoint"], + tags=["chargepoint (v1)"], ) -@router.get(path="/", response_model=list[ChargePoint]) +@router.get(path="", response_model=list[ChargePoint]) async def get_chargepoints( skip: int = 0, limit: int = 20, @@ -60,7 +60,7 @@ async def reset_chargepoint_password( db.commit() return ChargePointPassword(password=chargepoint.password) -@router.post(path="/", response_model=ChargePoint) +@router.post(path="", status_code=201, response_model=ChargePoint) async def create_chargepoint( chargepoint: ChargePointCreate, api_key: str = Security(get_api_key), @@ -91,7 +91,7 @@ async def update_chargepoint( db.commit() return chargepoint -@router.delete(path="/{chargepoint_id}", response_model=[]) +@router.delete(path="/{chargepoint_id}", response_model=None) async def delete_chargepoint( chargepoint_id: UUID, api_key: str = Security(get_api_key),