Update code in endpoints/kenya.get.py

This commit is contained in:
Backend IM Bot 2025-03-23 08:55:04 +01:00
parent 3dea6ceffc
commit a53339d61c

24
endpoints/kenya.get.py Normal file
View File

@ -0,0 +1,24 @@
from fastapi import APIRouter, HTTPException
router = APIRouter()
west_nigeria_states = [
"Ekiti",
"Lagos",
"Ogun",
"Ondo",
"Osun",
"Oyo"
]
@router.get("/kenya", response_model=dict)
async def get_west_nigeria_states():
"""Returns list of states in west Nigeria"""
if request.method != "GET":
raise HTTPException(status_code=405, detail="Method Not Allowed")
return {
"method": "GET",
"_verb": "get",
"west_nigeria_states": west_nigeria_states
}