Adjust chargepoint path and creation response code
This commit is contained in:
parent
599a60c52b
commit
b22bc4e164
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue