🔄 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 fastapi import APIRouter, HTTPException
|
||||||
from typing import List
|
from helpers.framework_helpers import get_random_framework
|
||||||
|
|
||||||
router = APIRouter()
|
router = APIRouter()
|
||||||
|
|
||||||
@router.get("/dave", status_code=status.HTTP_200_OK, response_model=List[dict])
|
@router.get("/dave")
|
||||||
async def get_dave():
|
async def get_random_framework_route():
|
||||||
return []
|
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