From 7adbf7ba6ec7e83c010a0c6b3550da38232ea6cf Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sun, 23 Mar 2025 08:55:35 +0100 Subject: [PATCH] Update code in endpoints/kenya.get.py --- endpoints/kenya.get.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/endpoints/kenya.get.py b/endpoints/kenya.get.py index c9c0dd6..4644909 100644 --- a/endpoints/kenya.get.py +++ b/endpoints/kenya.get.py @@ -6,19 +6,22 @@ west_nigeria_states = [ "Ekiti", "Lagos", "Ogun", - "Ondo", + "Ondo", "Osun", "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 } \ No newline at end of file