Update code in endpoints/france.post.py
This commit is contained in:
parent
f8cae240f6
commit
b903f703e6
@ -2,7 +2,7 @@ from fastapi import APIRouter, HTTPException
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
states = [
|
||||
states_in_france = [
|
||||
"Auvergne-Rhône-Alpes",
|
||||
"Bourgogne-Franche-Comté",
|
||||
"Bretagne",
|
||||
@ -19,7 +19,7 @@ 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")
|
||||
@ -27,5 +27,5 @@ async def get_france_states():
|
||||
return {
|
||||
"method": "POST",
|
||||
"_verb": "post",
|
||||
"states": states
|
||||
"states": states_in_france
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user