add api endpoint for getting all available districts
This commit is contained in:
parent
e05b4788e0
commit
a526f81517
1 changed files with 8 additions and 0 deletions
|
|
@ -15,6 +15,7 @@ from dotenv import load_dotenv
|
|||
from fastapi import Depends, FastAPI, HTTPException, Query
|
||||
from api.auth import User
|
||||
from models.listing import QueryParameters
|
||||
from rec import districts
|
||||
from repositories.listing_repository import ListingRepository
|
||||
from repositories.listing_repository import ListingRepository
|
||||
from database import engine
|
||||
|
|
@ -104,3 +105,10 @@ async def get_task_status(
|
|||
"status": task_result.status,
|
||||
"result": json.dumps(result),
|
||||
}
|
||||
|
||||
|
||||
@app.get("/api/get_districts")
|
||||
async def get_task_status(
|
||||
user: Annotated[User, Depends(get_current_user)],
|
||||
) -> dict[str, str]:
|
||||
return districts.get_districts()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue