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