2025-04-17 16:23:47 +00:00

19 lines
674 B
Python

from fastapi import APIRouter, Depends, HTTPException, status
# TODO: Import db session, schemas, models as needed
router = APIRouter()
@router.get("/names/{name_id}")
async def get_name_item(
name_id: Any, # TODO: Adjust type hint (e.g., int, str, UUID)
# db: Session = Depends(get_db) # Example dependency
):
"""first rest: Get item by ID"""
# TODO: Implement logic to fetch name with id: {name_id}
print(f"Fetching name with id: {name_id}")
# Example: Check if found, raise 404 if not
# if not found:
# raise HTTPException(status_code=status.HTTP_404_NOT_FOUND, detail="name not found")
return {"name_id": name_id} # Placeholder