Update code in endpoints/france.post.py

This commit is contained in:
Backend IM Bot 2025-03-23 10:43:56 +01:00
parent f8cae240f6
commit b903f703e6

View File

@ -2,7 +2,7 @@ from fastapi import APIRouter, HTTPException
router = APIRouter() router = APIRouter()
states = [ states_in_france = [
"Auvergne-Rhône-Alpes", "Auvergne-Rhône-Alpes",
"Bourgogne-Franche-Comté", "Bourgogne-Franche-Comté",
"Bretagne", "Bretagne",
@ -19,7 +19,7 @@ states = [
] ]
@router.post("/france") @router.post("/france")
async def get_france_states(): async def get_states_in_france():
"""endpoint that returns list of states in france""" """endpoint that returns list of states in france"""
if request.method != "POST": if request.method != "POST":
raise HTTPException(status_code=405, detail="Method Not Allowed") raise HTTPException(status_code=405, detail="Method Not Allowed")
@ -27,5 +27,5 @@ async def get_france_states():
return { return {
"method": "POST", "method": "POST",
"_verb": "post", "_verb": "post",
"states": states "states": states_in_france
} }