🔄 refactor: Enhance endpoints/dave.get.py endpoint functionality ✅ (auto-linted)
This commit is contained in:
parent
38b03a289d
commit
2f1cde171f
@ -1,8 +1,11 @@
|
||||
from fastapi import APIRouter, status
|
||||
from typing import List
|
||||
from fastapi import APIRouter, HTTPException
|
||||
from helpers.framework_helpers import get_random_framework
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.get("/dave", status_code=status.HTTP_200_OK, response_model=List[dict])
|
||||
async def get_dave():
|
||||
return []
|
||||
@router.get("/dave")
|
||||
async def get_random_framework_route():
|
||||
framework = get_random_framework()
|
||||
if not framework:
|
||||
raise HTTPException(status_code=404, detail="Failed to retrieve a random framework")
|
||||
return {"framework": framework}
|
Loading…
x
Reference in New Issue
Block a user