diff --git a/endpoints/endpint.get.py b/endpoints/endpint.get.py index e69de29..8178976 100644 --- a/endpoints/endpint.get.py +++ b/endpoints/endpint.get.py @@ -0,0 +1,18 @@ +# Entity: Color + +from fastapi import APIRouter, Depends, HTTPException, status +from sqlalchemy.orm import Session +from typing import List +from core.database import get_db +from models.color import Color +from schemas.color import ColorSchema + +router = APIRouter() + +@router.get("/endpoint", response_model=List[ColorSchema], status_code=200) +async def get_colors( + db: Session = Depends(get_db) +): + """Get all colors""" + colors = db.query(Color).all() + return colors \ No newline at end of file