From 3cd238145bbabc731d7d26f83b85fa8993778623 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 20 Mar 2025 20:24:49 +0100 Subject: [PATCH] Update code in endpoints/states.get.py --- endpoints/states.get.py | 51 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 endpoints/states.get.py diff --git a/endpoints/states.get.py b/endpoints/states.get.py new file mode 100644 index 0000000..6b19b63 --- /dev/null +++ b/endpoints/states.get.py @@ -0,0 +1,51 @@ +from fastapi import APIRouter, Depends, HTTPException + +router = APIRouter() + +states = [ + "Abia", + "Adamawa", + "Akwa Ibom", + "Anambra", + "Bauchi", + "Bayelsa", + "Benue", + "Borno", + "Cross River", + "Delta", + "Ebonyi", + "Edo", + "Ekiti", + "Enugu", + "Gombe", + "Imo", + "Jigawa", + "Kaduna", + "Kano", + "Katsina", + "Kebbi", + "Kogi", + "Kwara", + "Lagos", + "Nasarawa", + "Niger", + "Ogun", + "Ondo", + "Osun", + "Oyo", + "Plateau", + "Rivers", + "Sokoto", + "Taraba", + "Yobe", + "Zamfara", + "FCT" +] + +@router.get("/states") +async def get_states(): + """Get list of states in Nigeria""" + return { + "message": "Success", + "data": states + } \ No newline at end of file