Update code in endpoints/kenya.get.py
This commit is contained in:
parent
a53339d61c
commit
7adbf7ba6e
@ -11,14 +11,17 @@ west_nigeria_states = [
|
||||
"Oyo"
|
||||
]
|
||||
|
||||
@router.get("/kenya", response_model=dict)
|
||||
@router.get("/kenya")
|
||||
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")
|
||||
raise HTTPException(status_code=405, detail={
|
||||
"message": "Method Not Allowed",
|
||||
"method": request.method,
|
||||
"_verb": "get"
|
||||
})
|
||||
|
||||
return {
|
||||
"method": "GET",
|
||||
"_verb": "get",
|
||||
"west_nigeria_states": west_nigeria_states
|
||||
"states": west_nigeria_states
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user